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::reproducer< OrganismType > Class Template Referenceabstract

Creates new organisms from an existing population. More...

#include <reproducer.h>

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

Public Member Functions

virtual ~reproducer ()
 Virtual destructor. More...
 
virtual vector< OrganismType > breed (const vector< OrganismType > &a_population, size_t a_limit)=0
 Creates children. More...
 

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::reproducer< OrganismType >

In most cases, a reproducer generates new organisms using parents selected (by fitness) from an existing population. In some singular (and probably rare) cases, a reproducer might generate new, random organisms in order to keep diversity high. Reproduction techniques can include crossover and asexual, sexual and (my favorite) try-sexual models.

Parameters
OrganismType- The type of organism

Constructor & Destructor Documentation

template<class OrganismType>
virtual libevocosm::reproducer< OrganismType >::~reproducer ( )
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 vector<OrganismType> libevocosm::reproducer< OrganismType >::breed ( const vector< OrganismType > &  a_population,
size_t  a_limit 
)
pure virtual

A population provides genetic material for the creation of new children (who, will, like real children, forget where they left their shoes).

Parameters
a_population- A population of organisms
a_limit- The maximum number of children the generate
Returns
A vector containing new "child" organisms

Implemented in libevocosm::function_reproducer.


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.