#ifndef EVALUATOR_H #define EVALUATIR_H #include #include "Genetic.h" #include "Graf.h" using namespace std; /** * class containing information about one task execution - start time, end time & the index of the associated processor */ class TaskInfo { public: /** * the minimum start time of execution */ int start; /** * the maximum end time of execution */ int end; /** * the index of the associated processor */ int proc_index; public: /** * the default constructor */ TaskInfo(); }; /** * class that implements the chromosomes of one population */ class Evaluator{ public: /** * the input graph of tasks */ TaskGraf tasks; /** * the input graph of processors */ ProcesorGraf procs; /** * the list of current time for each task */ int *proc_time; /** * the list of "task-processor" associations */ TaskInfo *task_info; public: /** * the default constructor */ Evaluator(); /** * the constructor * * @param TG the input graph of tasks * @param PG the input graph of processors */ Evaluator(TaskGraf &TG, ProcesorGraf &PG); /** * Method that evaluates one chromosome, computing its makespan, T1, T2, T3 * * @param ch the chromosome we want to evaluate */ void evaluateIndividual(Chromosome &ch); /** * Method that evaluates one population's performance * * @param ch the list of chromosomes */ void evaluatePopulation(vector &ch); }; #endif