ECF 1.5
GPSymbRegEvalOp.h
1#ifndef GPSymbRegEvalOp_h
2#define GPSymbRegEvalOp_h
3
4
27#include <cmath>
28#include <ecf/ECF.h>
29#include <fstream>
30#include "Evaluator.h"
31#include "DataWriter.h"
32#include "ErrorMetric.h"
33
35{
36public:
37 FitnessP evaluate(IndividualP individual);
38 bool initialize(StateP);
39 void registerParameters(StateP);
40 bool csvRead(StateP state, std::string entry, std::vector<double>* vec);
41 void readIndividual(IndividualP individual);
42
43 std::vector<double> x;
44 std::vector<double> y;
45 std::vector<double> f;
46 uint nSamples;
47 uint nVariables;
48 std::vector<string> varNames;
49 bool linearScaling;
50
51 Evaluator eval;
52
53 bool printParams;
54 DataWriter* dataWriter;
55 bool errorWeightsDefined;
56 std::vector<double> errorWeights;
57
58 ErrorMetric* errorMetric;
59
60private:
61 FitnessP evaluateUsingLinearScaling(IndividualP individual);
62 FitnessP evaluateWithoutLinearScaling(IndividualP individual);
63
64};
65typedef boost::shared_ptr<GPSymbRegEvalOp> GPSymbRegEvalOpP;
66
67#endif // GPSymbRegEvalOp_h
Evaluation base class.
Definition: EvaluateOp.h:17
Symbolic regression evaluation operator.
bool initialize(StateP)
Initialize the evaluator. Called before first evaluation occurs.
void registerParameters(StateP)
Register evaluator parameters. Called before EvaluateOp::initialize method.
FitnessP evaluate(IndividualP individual)
Evaluate a single individual. Method must create and return a Fitness object.