Evocosm - A C++ Framework for Evolutionary Computing

Main Index

Created by Scott Robert Ladd at Coyote Gulch Productions.


Public Member Functions | Protected Attributes | List of all members
libevocosm::landscape< OrganismType > Class Template Referenceabstract

An abstract interface defining a fitness landscape. More...

#include <landscape.h>

Inheritance diagram for libevocosm::landscape< OrganismType >:
libevocosm::globals

Public Member Functions

 landscape (listener< OrganismType > &a_listener)
 Constructor. More...
 
 landscape (const landscape &a_source)
 Copy constructor.
 
landscapeoperator= (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 Protected Member Functions inherited from libevocosm::globals
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 Protected Attributes inherited from libevocosm::globals
static prng g_random
 A shared random number generator.
 
static std::string g_version
 Version number.
 

Detailed Description

template<class OrganismType>
class libevocosm::landscape< OrganismType >

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.

Parameters
OrganismType- A concrete implementation of the organism template (e.g., the type of organism that "lives" in this landscape)

Constructor & Destructor Documentation

template<class OrganismType>
libevocosm::landscape< OrganismType >::landscape ( listener< OrganismType > &  a_listener)
inline

Creates a new landscape object

Parameters
a_listener- a listener for events
template<class OrganismType>
virtual libevocosm::landscape< OrganismType >::~landscape ( )
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.

Member Function Documentation

template<class OrganismType>
virtual double libevocosm::landscape< OrganismType >::test ( OrganismType &  a_organism,
bool  a_verbose = false 
) const
pure virtual

Tests a single chromosome for fitness.

Parameters
a_organism- The organism to be tested by the landscape.
a_verbose- Display verbose information for test
Returns
Computed fitness for this organism

Implemented in libevocosm::function_landscape.

Referenced by libevocosm::landscape< function_solution >::test().

template<class OrganismType>
virtual double libevocosm::landscape< OrganismType >::test ( vector< OrganismType > &  a_population) const
inlinevirtual

Tests each chromosome in a_population for fitness.

Parameters
a_population- A vector containing organisms to be tested by the landscape.
Returns
A fitness value for the population as a whole; application-defined.

The documentation for this class was generated from the following file:

© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.