Evocosm - A C++ Framework for Evolutionary Computing

Main Index

Created by Scott Robert Ladd at Coyote Gulch Productions.


Public Member Functions | Protected Attributes
libevocosm::landscape< OrganismType > Class Template Reference

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

#include <landscape.h>

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

List of all members.

Public Member Functions

Protected Attributes


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 ( ) [inline, virtual]

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 [inline, virtual]

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.