You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
626 B
Python
28 lines
626 B
Python
FluidKDTree : FluidManipulationClient {
|
|
|
|
var id;
|
|
|
|
*new {|server|
|
|
var uid = UniqueID.next;
|
|
^super.new(server,uid)!?{|inst|inst.init(uid);inst}
|
|
}
|
|
|
|
init {|uid|
|
|
id = uid;
|
|
}
|
|
|
|
fit{|dataset,action|
|
|
dataset.asSymbol.postln;
|
|
this.prSendMsg(\fit,[dataset.asSymbol],action);
|
|
}
|
|
|
|
kNearest{ |buffer, k,action|
|
|
this.prSendMsg(\kNearest,[buffer.asUGenInput,k],action,k.collect{string(FluidMessageResponse,_,_)});
|
|
}
|
|
|
|
kNearestDist { |buffer, k,action|
|
|
this.prSendMsg(\kNearestDist,[buffer.asUGenInput,k],action,[numbers(FluidMessageResponse,_,k,_)]);
|
|
}
|
|
|
|
}
|