#ifndef GGA_H
#define GGA_H

#include <iostream>

#include <vector>
#include <algorithm>
#include <random>

#include "SearchHeuristic.h"

#define COMMA 1
#define PLUS 2

#define GA_V1 1
#define GA_V2 2

class GGA : public SearchHeuristic
{
    public:
        GGA(int mu, int lda, int selection, double sbm_proba, int crossover_method, int version, std::default_random_engine& randomizer);
        GGA(int mu, int lda, int selection, double sbm_proba, int crossover_method, std::default_random_engine& randomizer) :
            GGA(mu, lda, selection, sbm_proba, crossover_method, GA_V1, randomizer) {};
        void prepare_tab();
        virtual double get_crossover_proba(double progress) = 0;
        virtual double get_sbm_proba(double progress) = 0;
        Result run();
        virtual ~GGA();

    protected:
        int m_mu;
        int m_lambda;
        int m_selection;
        double m_sbm_proba;
        int m_crossover_method;
        int m_version;

        std::default_random_engine m_randomizer;
        std::binomial_distribution<int> m_binomial_dist;
        std::uniform_int_distribution<int> m_uniform_dist;
        bool m_is_prepared;
        Candidate** x_tab;

    private:
};

#endif // GGA_H
