(spawnpoints, radius, time_threshold)
| 96 | return True |
| 97 | |
| 98 | def cluster(spawnpoints, radius, time_threshold): |
| 99 | clusters = [] |
| 100 | diameter = 2 * radius |
| 101 | |
| 102 | for p in spawnpoints: |
| 103 | if len(clusters) == 0: |
| 104 | clusters.append(Spawncluster(p)) |
| 105 | else: |
| 106 | c = min(clusters, key=lambda x: cost(p, x, time_threshold)) |
| 107 | |
| 108 | if check_cluster(p, c, radius, time_threshold): |
| 109 | c.append(p) |
| 110 | else: |
| 111 | c = Spawncluster(p) |
| 112 | clusters.append(c) |
| 113 | |
| 114 | return clusters |
| 115 | |
| 116 | def test(cluster, radius, time_threshold): |
| 117 | assert cluster.max_time - cluster.min_time <= time_threshold |
no test coverage detected