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::elitism_selector< OrganismType > Class Template Reference

Implements a elitism selector. More...

#include <selector.h>

Inheritance diagram for libevocosm::elitism_selector< OrganismType >:
libevocosm::selector< OrganismType > libevocosm::globals

Public Member Functions

 elitism_selector (double a_factor=0.9)
 Constructor. More...
 
 elitism_selector (const elitism_selector< OrganismType > &a_source)
 Copy constructor. More...
 
elitism_selectoroperator= (const elitism_selector< OrganismType > &a_source)
 Assignment operator. More...
 
virtual vector< OrganismType > select_survivors (vector< OrganismType > &a_population)
 Select individuals that survive. More...
 
- Public Member Functions inherited from libevocosm::selector< OrganismType >
virtual ~selector ()
 Virtual destructor. 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::elitism_selector< OrganismType >

Elitism is one of the simplest type of selection – it simply says that the n best organisms will survive into the next generation.

Parameters
OrganismType- The type of organism

Constructor & Destructor Documentation

template<class OrganismType>
libevocosm::elitism_selector< OrganismType >::elitism_selector ( double  a_factor = 0.9)
inline

Constructs a new elistism_selector with a value that defines the number of organisms that should survive into the next generation.

Parameters
a_factor- Percentage of bets fitness required to surivive
template<class OrganismType>
libevocosm::elitism_selector< OrganismType >::elitism_selector ( const elitism_selector< OrganismType > &  a_source)
inline

Creates a new object identical to an existing one.

Parameters
a_source- The source object

Member Function Documentation

template<class OrganismType>
elitism_selector& libevocosm::elitism_selector< OrganismType >::operator= ( const elitism_selector< OrganismType > &  a_source)
inline

Assigns an existing object the state of another.

Parameters
a_source- The source object
template<class OrganismType>
vector< OrganismType > libevocosm::elitism_selector< OrganismType >::select_survivors ( vector< OrganismType > &  a_population)
virtual

Produces a vector containing copies of the organisms selected for survival.

Parameters
a_population- A population of organisms
Returns
A population of copied survivors

Implements libevocosm::selector< OrganismType >.

References libevocosm::fitness_stats< OrganismType >::getBest().


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.