diff --git a/tools/yulPhaser/main.cpp b/tools/yulPhaser/main.cpp index eea43e5fb..d3ea9d713 100644 --- a/tools/yulPhaser/main.cpp +++ b/tools/yulPhaser/main.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -29,7 +30,6 @@ #include #include -#include #include using namespace std; @@ -71,14 +71,26 @@ CharStream loadSource(string const& _sourcePath) void runAlgorithm(string const& _sourcePath) { + constexpr size_t minChromosomeLength = 12; + constexpr size_t maxChromosomeLength = 30; + CharStream sourceCode = loadSource(_sourcePath); shared_ptr fitnessMetric = make_shared(Program::load(sourceCode), 5); auto population = Population::makeRandom( fitnessMetric, 10, - bind(Population::binomialChromosomeLength, Population::MaxChromosomeLength) + minChromosomeLength, + maxChromosomeLength ); - population.run(nullopt, cout); + RandomAlgorithm( + population, + cout, + { + /* elitePoolSize = */ 0.5, + /* minChromosomeLength = */ minChromosomeLength, + /* maxChromosomeLength = */ maxChromosomeLength, + } + ).run(); } CommandLineParsingResult parseCommandLine(int argc, char** argv)