def distancesTo(self, vector): """ Computes euclidean distance from a vector to all model vectors. Note: uses mask to scale. """ retval = [] for m in self.ravq.models: retval.append( euclideanDistance(vector, m.vector, self.ravq.mask) ) return retval
def incompatibility(self): """ For each model, how different is it from each of the buffer items? Returns list of incompatibilities. Note: uses mask to scale. """ retval = [] for model in self.ravq.models: sum = 0.0 for buff in model.contents: sum += euclideanDistance(model.vector, buff, self.ravq.mask) retval.append(sum) return retval