Created by Scott Robert Ladd at Coyote Gulch Productions.
Defines the test for a population of solutions. More...
#include <function_optimizer.h>
A "fitness" landscape defines the environment in which an organism competes for survival. In the case of function optimization, the "test" is (obviously!) a function.
libevocosm::function_landscape::function_landscape | ( | t_function * | a_function, |
listener< function_solution > & | a_listener | ||
) | [inline] |
Creates a new landscape with a given fitness function.
a_function | function to be tested |
a_listener | a listener for events during testing |
libevocosm::function_landscape::~function_landscape | ( | ) | [inline] |
Satisfies the requirements of the base class; does nothing at this time.
virtual double libevocosm::function_landscape::test | ( | function_solution & | a_organism, |
bool | a_verbose = false |
||
) | const [inline, virtual] |
Tests a single chromosome for fitness by calling the fitness function provided in the constructor.
a_organism | the organism to be tested by the landscape. |
a_verbose | should this test produce lots of output? |
Implements libevocosm::landscape< function_solution >.
References libevocosm::organism< Genotype >::fitness, libevocosm::organism< Genotype >::genes, and libevocosm::function_solution::value.
© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.