(spawnpoint, cluster, time_threshold)
| 68 | return new_centroid |
| 69 | |
| 70 | def 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 | |
| 81 | def check_cluster(spawnpoint, cluster, radius, time_threshold): |
| 82 | # discard infinite cost or too far away |
no outgoing calls
no test coverage detected