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

Defines migration between populations. More...

#include <migrator.h>

Inheritance diagram for libevocosm::migrator< OrganismType >:
libevocosm::globals libevocosm::null_migrator< OrganismType > libevocosm::random_pool_migrator< OrganismType >

Public Member Functions

virtual ~migrator ()
 Virtual destructor. More...
 
virtual void migrate (vector< vector< OrganismType > > &a_populations)=0
 Removes organisms from a population for later immigration. 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_random_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::migrator< OrganismType >

A migrator removes individuals (via "emigration") from a population of organisms, transferring them to another population (via "immigration"). A concrete implementation of this interface will probably contain some sort of organism "pool"; migration will place organisms into the pool, and immigration will remove them.

Parameters
OrganismType- The type of organism that will be migrating

Constructor & Destructor Documentation

template<class OrganismType>
virtual libevocosm::migrator< OrganismType >::~migrator ( )
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 void libevocosm::migrator< OrganismType >::migrate ( vector< vector< OrganismType > > &  a_populations)
pure virtual

Calling emigrate will remove organisms from a population; these "mgrating" organisms will then be available for addition to another population via the immigrate method. The criteria for emigration is application-specific. Nothing requires that an organism be removed from its original population – that is simply how "real" life works, when an animal leaves its home (say, a male lion leaving its pride) to join another population.

Parameters
a_populations- Set of organism populations between which members will "migrate"

Implemented in libevocosm::random_pool_migrator< OrganismType >, and libevocosm::null_migrator< OrganismType >.


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.