[yul-phaser] Add options for selecting crossover operator used by the algorithms

This commit is contained in:
Kamil Śliwak
2020-04-20 15:30:10 +02:00
parent ad89b477c8
commit d9e2735361
6 changed files with 68 additions and 3 deletions
+10
View File
@@ -51,6 +51,8 @@ protected:
/* mutationChance = */ 0.0,
/* deletionChance = */ 0.0,
/* additionChance = */ 0.0,
/* CrossoverChoice = */ CrossoverChoice::SinglePoint,
/* uniformCrossoverSwapChance= */ 0.5,
};
};
@@ -113,6 +115,8 @@ BOOST_FIXTURE_TEST_CASE(runNextRound_should_preserve_elite_and_regenerate_rest_o
/* deletionVsAdditionChance = */ 1.0,
/* percentGenesToRandomise = */ 0.0,
/* percentGenesToAddOrDelete = */ 1.0,
/* CrossoverChoice = */ CrossoverChoice::SinglePoint,
/* uniformCrossoverSwapChance= */ 0.5,
};
GenerationalElitistWithExclusivePools algorithm(options);
@@ -133,6 +137,8 @@ BOOST_FIXTURE_TEST_CASE(runNextRound_should_not_replace_elite_with_worse_individ
/* deletionVsAdditionChance = */ 0.0,
/* percentGenesToRandomise = */ 0.0,
/* percentGenesToAddOrDelete = */ 1.0,
/* CrossoverChoice = */ CrossoverChoice::SinglePoint,
/* uniformCrossoverSwapChance= */ 0.5,
};
GenerationalElitistWithExclusivePools algorithm(options);
@@ -152,6 +158,8 @@ BOOST_FIXTURE_TEST_CASE(runNextRound_should_generate_individuals_in_the_crossove
/* deletionVsAdditionChance = */ 0.5,
/* percentGenesToRandomise = */ 1.0,
/* percentGenesToAddOrDelete = */ 1.0,
/* CrossoverChoice = */ CrossoverChoice::SinglePoint,
/* uniformCrossoverSwapChance= */ 0.5,
};
GenerationalElitistWithExclusivePools algorithm(options);
@@ -179,6 +187,8 @@ BOOST_FIXTURE_TEST_CASE(runNextRound_should_generate_individuals_in_the_crossove
/* deletionVsAdditionChance = */ 0.0,
/* percentGenesToRandomise = */ 0.0,
/* percentGenesToAddOrDelete = */ 0.0,
/* CrossoverChoice = */ CrossoverChoice::SinglePoint,
/* uniformCrossoverSwapChance= */ 0.5,
};
GenerationalElitistWithExclusivePools algorithm(options);