예제 #1
0
파일: nSect.py 프로젝트: bobbysoon/Taxi3
def nSect(p, ca):
	dists= [mDist(c,p) for c in ca]
	minDist,maxDist = min(dists),max(dists)
	if maxDist-minDist>epsilon: return False
	for c in Centroid.centroids:
		if not c in ca:
			if mDist(c,p) <= minDist:
				return False
	return True
예제 #2
0
파일: Centroid.py 프로젝트: bobbysoon/Taxi3
	def at(cls,p):
		dists= [ (mDist(p,c),c) for c in Centroid.centroids ]
		return [p for d,p in sorted(dists,key=lambda x: x[0])][0]
예제 #3
0
def DistSort(p, C):
    dists = [(mDist(p, c), c) for c in C]
    return [p for d, p in sorted(dists, key=lambda x: x[0])]
예제 #4
0
파일: DistSort.py 프로젝트: bobbysoon/Taxi3
def DistSort(p,C):
	dists=[ (mDist(p,c),c) for c in C]
	return [p for d,p in sorted(dists,key=lambda x: x[0])]
예제 #5
0
파일: Centroid.py 프로젝트: bobbysoon/Taxi3
 def at(cls, p):
     dists = [(mDist(p, c), c) for c in Centroid.centroids]
     return [p for d, p in sorted(dists, key=lambda x: x[0])][0]