Evaluator Class Reference

Evaluates individuals against criteria. More...

#include <Evaluator.hpp>

List of all members.

Public Member Functions

 Evaluator ()
virtual double evaluate (Individual &ind, Context &context)


Detailed Description

Evaluates individuals against criteria.

Author:
Stephen E. Baker
Date:
2006-2007
Version:
1.0
Calculates the fitness of individuals by setting up the context, running them and comparing the result to the expected value. At least this class must be modified or extended for any new problem.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
[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
Returns:
The fitness value
Warning:
If the GP is keeping track of hits, they must be added to the individual using setHits
See also:
Individual::setHits

Context::setArgumentValue

Context::clear

Individual::execute

Result


The documentation for this class was generated from the following files:
Generated on Mon Jan 15 01:21:04 2007 for Creatively Named Grammar Guided Genetic Programming System by  doxygen 1.4.7