Evocosm - A C++ Framework for Evolutionary Computing

Main Index

Created by Scott Robert Ladd at Coyote Gulch Productions.


Public Member Functions | List of all members
libevocosm::function_landscape Class Reference

Defines the test for a population of solutions. More...

#include <function_optimizer.h>

Inheritance diagram for libevocosm::function_landscape:
libevocosm::landscape< function_solution > libevocosm::fopt_global libevocosm::globals

Public Member Functions

 function_landscape (t_function *a_function, listener< function_solution > &a_listener)
 Creation constructor. More...
 
 function_landscape (const function_landscape &a_source)
 Copy constructor.
 
function_landscapeoperator= (const function_landscape &a_source)
 Assignment.
 
 ~function_landscape ()
 Virtual destructor. More...
 
virtual double test (function_solution &a_organism, bool a_verbose=false) const
 Performs fitness testing. More...
 
- Public Member Functions inherited from libevocosm::landscape< function_solution >
 landscape (listener< function_solution > &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 (vector< function_solution > &a_population) const
 Performs fitness testing. More...
 

Additional Inherited Members

- Protected Types inherited from libevocosm::fopt_global
typedef vector< double > t_function(vector< double > a_args)
 Definition of a function type. More...
 
- 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.
 
- Protected Attributes inherited from libevocosm::landscape< function_solution >
listener< function_solution > & m_listener
 The listener for landscape events.
 
- Static Protected Attributes inherited from libevocosm::globals
static prng g_random
 A shared random number generator.
 
static std::string g_version
 Version number.
 
- Static Protected Attributes inherited from libevocosm::fopt_global
static evoreal g_evoreal
 Provides mutation and crossover services for doubles.
 

Detailed Description

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.

Constructor & Destructor Documentation

libevocosm::function_landscape::function_landscape ( t_function a_function,
listener< function_solution > &  a_listener 
)
inline

Creates a new landscape with a given fitness function.

Parameters
a_functionfunction to be tested
a_listenera listener for events during testing
libevocosm::function_landscape::~function_landscape ( )
inline

Satisfies the requirements of the base class; does nothing at this time.

Member Function Documentation

virtual double libevocosm::function_landscape::test ( function_solution a_organism,
bool  a_verbose = false 
) const
inlinevirtual

Tests a single chromosome for fitness by calling the fitness function provided in the constructor.

Parameters
a_organismthe organism to be tested by the landscape.
a_verboseshould this test produce lots of output?
Returns
Computed fitness for this organism

Implements libevocosm::landscape< function_solution >.

References libevocosm::organism< Genotype >::fitness, libevocosm::organism< Genotype >::genes, and libevocosm::function_solution::value.


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.