1#ifndef FUNCTIONMAXEVALOP_H_
2#define FUNCTIONMAXEVALOP_H_
13 FitnessP fitness =
static_cast<FitnessP
> (
new FitnessMax);
15 Binary* bin = (Binary*) individual->at(0).get();
21 for (uint i = 0; i < bin->variables.size(); i++){
22 realTemp = pow((bin->realValue.at(i) - (i + 1)), 2.);
23 fitness->value_ = fitness->value_ - realTemp;
25 printf (
"Vrijednost fitness funkcije: %f\n", fitness->value_);
30typedef boost::shared_ptr<FunctionMaxEvalOp> FunctionMaxEvalOpP;
Fitness for maximization problems.
FitnessP evaluate(IndividualP individual)
Evaluate a single individual. Method must create and return a Fitness object.