#include "experiences/compare-evolutions.h"

void script_cmp_evolution_algos(std::default_random_engine& randomizer) {
    int n=20;
    MasterMind mm(n, n, randomizer);
    RLS algo1;
    EA algo2(1, 1, PLUS, 1./n, randomizer);
    GA algo3(1, 1, PLUS, 1./n, cr(n, 1), UNIFORM_CROSSOVER, GA_V1, randomizer);
    GA algo4(1, 1, PLUS, 1./n, .8, UNIFORM_CROSSOVER, GA_V1, randomizer);
    PEA algo5(1, 1, PLUS, {}, randomizer);
    algo1.set_problem(&mm);
    algo2.set_problem(&mm);
    algo3.set_problem(&mm);
    algo4.set_problem(&mm);
    algo5.set_problem(&mm);
    std::vector<SearchHeuristic*> algos = {&algo1, &algo2, &algo3, &algo4, &algo5};

    Statistic stat = avg_calls(&algo1, 20, -1, 3.883);
    int max_nb_calls = ceil(stat.average+stat.alea)*2;
    cmp_evolution(algos, mm, "evolutions.csv", max_nb_calls, 100);
}
