Created by Scott Robert Ladd at Coyote Gulch Productions.
An abstract interface defining a fitness landscape. More...
#include <landscape.h>
Public Member Functions | |
landscape (listener< OrganismType > &a_listener) | |
Constructor. More... | |
landscape (const landscape &a_source) | |
Copy constructor. | |
landscape & | operator= (const landscape &a_source) |
Assignment operator. | |
virtual | ~landscape () |
Virtual destructor. More... | |
virtual double | test (OrganismType &a_organism, bool a_verbose=false) const =0 |
Performs fitness testing. More... | |
virtual double | test (vector< OrganismType > &a_population) const |
Performs fitness testing. More... | |
Protected Attributes | |
listener< OrganismType > & | m_listener |
The listener for landscape events. | |
Additional Inherited Members | |
![]() | |
static size_t | rand_index (size_t n) |
Static function to allow use of g_random function pointer in random_shuffle. | |
static void | set_seed (uint32_t a_seed) |
Set the seed for the random number generator. | |
static uint32_t | get_seed () |
Set the seed for the random number generator. | |
static std::string | version () |
Get version number. | |
![]() | |
static prng | g_random |
A shared random number generator. | |
static std::string | g_version |
Version number. | |
A "fitness" landscape defines the environment in which an organism competes for survival. A class implementing this interface will test each organism in a list against some criteria. The landscape is tied to the nature of the organism; think of an organism as a potential solution to a problem posed by the landscape.
A floating-point organism, for example, could be tested by a fitness landscape that represents a function to be maximized. Or, an organsism describing the shape of wing could be tested by a landscape implementation that understands airflow.
OrganismType | - A concrete implementation of the organism template (e.g., the type of organism that "lives" in this landscape) |
|
inline |
Creates a new landscape object
a_listener | - a listener for events |
|
inlinevirtual |
A virtual destructor. By default, it does nothing; this is a placeholder that identifies this class as a potential base, ensuring that objects of a derived class will have their destructors called if they are destroyed through a base-class pointer.
|
pure virtual |
Tests a single chromosome for fitness.
a_organism | - The organism to be tested by the landscape. |
a_verbose | - Display verbose information for test |
Implemented in libevocosm::function_landscape.
Referenced by libevocosm::landscape< function_solution >::test().
|
inlinevirtual |
Tests each chromosome in a_population for fitness.
a_population | - A vector containing organisms to be tested by the landscape. |
© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.