#ifndef MUTATION_RATE_H_INCLUDED
#define MUTATION_RATE_H_INCLUDED

#include <sstream>
#include <string>

#include "analysis/ParameterOptimizer.h"
#include "heuristics/EA.h"
#include "problems/MasterMind.h"

class ProbaOptimizer : public ParameterOptimizer {
    public:
        ProbaOptimizer(int initial_n, std::default_random_engine& randomizer) : ParameterOptimizer(randomizer), m_initial_n{initial_n} {};
        SearchHeuristic* get_context(unsigned int i, double parameter, std::default_random_engine& randomizer) {
            EA* algo = new EA(1, 1, PLUS, parameter, randomizer);
            MasterMind* mm = new MasterMind(m_initial_n+i, m_initial_n+i, randomizer);
            algo->set_problem(mm);
            return algo;
        }
        virtual std::string display_context(unsigned int context) {
           std::stringstream ss;
           ss << "n=" << context+m_initial_n;
           return ss.str();
        }
        std::string get_context_for_csvfile(unsigned int num_context) {
           return std::to_string(m_initial_n+num_context);
        }

    private:
        int m_initial_n;
};

#endif // MUTATION_RATE_H_INCLUDED
