Evaluates population and calculates population fitness. Assigns array of evalutaion and fitness properties for population.
It is important for the code not only to evaluate all the population members but also to set Fitness and Evaluation properties of the population.
protected override void EvaluatePopulation(Population population)
{
....
double[] evaluation = new double[population.Size];
double[] fitness = new double[population.Size];
... Evaluate population ad populate above declared arrays ...
//Assign population evaluation.
population.Evaluation = evaluation;
//Assign population fitness.
population.Fitness = fitness;
}
GeneticAlgorithm Class | AnticipatingMinds.ArtificialMind.GeneticAlgorithms Namespace