@@ -334,19 +334,19 @@ TYPED_TEST(APopulation, ConcurrentSafeAccessorsKeepIndicesAndFitnessValid) {
334334
335335 executeConcurrent ([&] {
336336 for (size_t i = 0 ; i < 200 ; ++i) {
337- const size_t idx = pop.randomIndividualSafe (this ->context );
337+ const size_t idx = pop.randomIndividualSafe (this ->context . partition . deterministic );
338338 EXPECT_LT (idx, pop.size ());
339339 EXPECT_EQ (pop.bestFitnessSafe (), expected_best_fitness);
340340 EXPECT_LT (pop.bestSafe (), pop.size ());
341341 }
342342 }, [&] {
343343 for (size_t i = 0 ; i < 200 ; ++i) {
344- const size_t idx = pop.randomIndividualSafe (this ->context );
344+ const size_t idx = pop.randomIndividualSafe (this ->context . partition . deterministic );
345345 EXPECT_LT (idx, pop.size ());
346346 EXPECT_EQ (pop.fitnessAtSafe (pop.bestSafe ()), expected_best_fitness);
347347 EXPECT_EQ (pop.bestPartitionCopySafe ().size (), 7 );
348348 EXPECT_EQ (pop.partitionCopySafe (idx).size (), 7 );
349- EXPECT_EQ (pop.randomIndividualPartitionCopySafe (this ->context ).size (), 7 );
349+ EXPECT_EQ (pop.randomIndividualPartitionCopySafe (this ->context . partition . deterministic ).size (), 7 );
350350 }
351351 });
352352}
@@ -395,20 +395,20 @@ TYPED_TEST(APopulation, DeterministicSafeRandomMethodsAreStableAcrossThreads) {
395395 std::vector<std::vector<PartitionID>> expected_partitions;
396396 expected_partitions.reserve (100 );
397397 for (size_t i = 0 ; i < 100 ; ++i) {
398- expected_idxs.push_back (pop.randomIndividualSafe (ctx, &rng));
399- expected_partitions.push_back (pop.randomIndividualPartitionCopySafe (ctx, &rng));
398+ expected_idxs.push_back (pop.randomIndividualSafe (ctx. partition . deterministic , &rng));
399+ expected_partitions.push_back (pop.randomIndividualPartitionCopySafe (ctx. partition . deterministic , &rng));
400400 }
401401 executeConcurrent ([&] {
402402 std::mt19937 thread_rng (ctx.partition .seed );
403403 for (size_t i = 0 ; i < 100 ; ++i) {
404- EXPECT_EQ (pop.randomIndividualSafe (ctx, &thread_rng), expected_idxs[i]);
405- EXPECT_EQ (pop.randomIndividualPartitionCopySafe (ctx, &thread_rng), expected_partitions[i]);
404+ EXPECT_EQ (pop.randomIndividualSafe (ctx. partition . deterministic , &thread_rng), expected_idxs[i]);
405+ EXPECT_EQ (pop.randomIndividualPartitionCopySafe (ctx. partition . deterministic , &thread_rng), expected_partitions[i]);
406406 }
407407 }, [&] {
408408 std::mt19937 thread_rng (ctx.partition .seed );
409409 for (size_t i = 0 ; i < 100 ; ++i) {
410- EXPECT_EQ (pop.randomIndividualSafe (ctx, &thread_rng), expected_idxs[i]);
411- EXPECT_EQ (pop.randomIndividualPartitionCopySafe (ctx, &thread_rng), expected_partitions[i]);
410+ EXPECT_EQ (pop.randomIndividualSafe (ctx. partition . deterministic , &thread_rng), expected_idxs[i]);
411+ EXPECT_EQ (pop.randomIndividualPartitionCopySafe (ctx. partition . deterministic , &thread_rng), expected_partitions[i]);
412412 }
413413 });
414414}
@@ -444,7 +444,7 @@ TYPED_TEST(APopulation, ConcurrentInsertsAndSafeReadsRemainConsistent) {
444444 }
445445 }, [&] {
446446 for (size_t i = 0 ; i < 300 ; ++i) {
447- const size_t idx = this ->population .randomIndividualSafe (this ->context );
447+ const size_t idx = this ->population .randomIndividualSafe (this ->context . partition . deterministic );
448448 EXPECT_LT (idx, this ->population .size ());
449449 EXPECT_LT (this ->population .bestSafe (), this ->population .size ());
450450
0 commit comments