00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef EVALUATION_H
00021 #define EVALUATION_H
00022
00023 #include "gaconfig.h"
00024 #include "parametersettable.h"
00025
00026 namespace farsa {
00027
00028 class Genotype;
00029 class Genome;
00030 class GeneticAlgo;
00031
00047 class FARSA_GA_API Evaluation : public ParameterSettableWithConfigureFunction {
00048 public:
00050 Evaluation();
00052 virtual ~Evaluation();
00056 void initialize( Genotype* genotypeToEvaluate );
00061 void evaluateStep();
00065 void evaluate();
00067 void finalize();
00069 bool isEvaluationDone();
00071 Genotype* genotype() {
00072 return genotypev;
00073 };
00075 unsigned int genotypeID() {
00076 return genotypeid;
00077 };
00079 void setGenome( Genome* g ) {
00080 genomev = g;
00081 };
00083 Genome* genome() {
00084 return genomev;
00085 };
00087 void setGA( GeneticAlgo* g ) {
00088 ga = g;
00089 };
00091 GeneticAlgo* GA() {
00092 return ga;
00093 };
00095 const GeneticAlgo* GA() const {
00096 return ga;
00097 };
00098
00100 virtual Evaluation* clone() const = 0;
00101
00102 protected:
00104 virtual void init() = 0;
00106 virtual void step() = 0;
00108 virtual void fini() = 0;
00109
00113 void evaluationDone();
00114
00115 private:
00117 bool isDone;
00119 bool isInitialized;
00121 bool isFinalized;
00123 Genotype* genotypev;
00125 unsigned int genotypeid;
00127 Genome* genomev;
00129 GeneticAlgo* ga;
00130 };
00131
00132 }
00133
00134 #endif