MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / cost

Function cost

Tools/Spawnpoint-Clustering/cluster.py:70–79  ·  view source on GitHub ↗
(spawnpoint, cluster, time_threshold)

Source from the content-addressed store, hash-verified

68 return new_centroid
69
70def cost(spawnpoint, cluster, time_threshold):
71 distance = utils.distance(spawnpoint.position, cluster.centroid)
72
73 min_time = min(cluster.min_time, spawnpoint.time)
74 max_time = max(cluster.max_time, spawnpoint.time)
75
76 if max_time - min_time > time_threshold:
77 return float('inf')
78
79 return distance
80
81def check_cluster(spawnpoint, cluster, radius, time_threshold):
82 # discard infinite cost or too far away

Callers 2

check_clusterFunction · 0.85
clusterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected