@@ -65,9 +65,9 @@ public function testScenarioRegion50000(ClusteringAlgorithmInterface $algorithm,
65
65
*
66
66
* @dataProvider algorithmProvider
67
67
*/
68
- public function testScenarioCountry50000 (ClusteringAlgorithmInterface $ algorithm , float $ zoom ): void
68
+ public function testScenarioCountry5000 (ClusteringAlgorithmInterface $ algorithm , float $ zoom ): void
69
69
{
70
- $ points = $ this ->generatePoints (500000 , 30 , 60 , -10 , 35 );
70
+ $ points = $ this ->generatePoints (5000 , 30 , 60 , -10 , 35 );
71
71
72
72
$ this ->runPerformanceTest ($ algorithm , $ points , $ zoom );
73
73
}
@@ -94,15 +94,14 @@ private function runPerformanceTest(ClusteringAlgorithmInterface $algorithm, arr
94
94
$ elapsed = microtime (true ) - $ startTime ;
95
95
96
96
$ this ->assertLessThan (2.0 , $ elapsed , $ algorithm ::class." took too long: {$ elapsed } seconds (zoom {$ zoom }, " .\count ($ points ).' points) ' );
97
- // echo $algorithm::class." ($zoom): ".($elapsed * 1000)." ms\n";
98
97
}
99
98
100
99
private function generatePoints (int $ count , float $ latMin , float $ latMax , float $ lngMin , float $ lngMax ): array
101
100
{
102
101
$ points = [];
103
102
for ($ i = 0 ; $ i < $ count ; ++$ i ) {
104
- $ lat = mt_rand ((int ) ($ latMin * 100 ), (int ) ($ latMax * 100 )) / 100.0 ;
105
- $ lng = mt_rand ((int ) ($ lngMin * 100 ), (int ) ($ lngMax * 100 )) / 100.0 ;
103
+ $ lat = random_int ((int ) ($ latMin * 100 ), (int ) ($ latMax * 100 )) / 100.0 ;
104
+ $ lng = random_int ((int ) ($ lngMin * 100 ), (int ) ($ lngMax * 100 )) / 100.0 ;
106
105
$ points [] = new Point ($ lat , $ lng );
107
106
}
108
107
0 commit comments