Evocosm - A C++ Framework for Evolutionary Computing

Main Index

Created by Scott Robert Ladd at Coyote Gulch Productions.


libevocosm::selector< OrganismType > Class Template Reference

Selects organisms that survive. More...

#include <selector.h>

Inheritance diagram for libevocosm::selector< OrganismType >:

libevocosm::globals libevocosm::elitism_selector< OrganismType > libevocosm::null_selector< OrganismType >

List of all members.

Public Member Functions


Detailed Description

template<class OrganismType>
class libevocosm::selector< OrganismType >

A selector decides which organisms survive from one generation to the next. Some evolutionary algorithms will not use a selector; others will. In general, it is effective to keep the "best" organisms from one generation ot the next, so that good genes do not become lost at random.

Of course, "real" nature isn't so kind; just because you're the biggest stag in the forest doesn't mean you won't get shot! In fact, that may say something about the "best" -- maybe the "best" stag is the one that is too ugly for anyone to hunt?

Parameters:
OrganismType - The type of organism being selected

Constructor & Destructor Documentation

template<class OrganismType>
virtual libevocosm::selector< OrganismType >::~selector (  )  [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 vector<OrganismType> libevocosm::selector< OrganismType >::select_survivors ( vector< OrganismType > &  a_population  )  [pure 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

Implemented in libevocosm::null_selector< OrganismType >, and libevocosm::elitism_selector< 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.