#include <Evaluator.hpp>
Public Member Functions | |
Evaluator () | |
virtual double | evaluate (Individual &ind, Context &context) |
Evaluator::Evaluator | ( | ) |
Creates and intializes evaluator object. If values need to be loaded from a file or any precalculation needs to be done it should be done here. This method is only executed once, whereas evaluate is run thousands of times depending on runtime parameters.
double Evaluator::evaluate | ( | Individual & | ind, | |
Context & | context | |||
) | [virtual] |
Evaluates an individual to determine it's fitness. Typically this method would setup the context, execute the individual with it, compare the result to the desired result, transform this into a fitness value between 0 and 1 where 1 is the highest, and associate this fitness value with the individual. It is recommended to read the included template and follow it closely.
[in,out] | ind | The individual or program to be evaluated |
[in,out] | context | The environment and argument values the program is to be run with |