Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

EAStrategy Class Reference

Search strategy for an evolutionary algorithm. More...

#include <strategy.h>

List of all members.

Public Types

enum  traceflags

Public Methods

 EAStrategy (SimplePopulation &popula)
void evolve (EAEnvironment &envr, TextOStream &out, TextOStream &log)
virtual void addFeaturesTo (Genome &genome) const
void print (TextOStream &out)
void recombine (const SelectionSituation &situation, const SelectionMatrix &selmat)
void check () const

Protected Attributes

SimplePopulationmrPopula
Array< Individual > * mpNextGen
bool allow_same_parents


Detailed Description

Search strategy for an evolutionary algorithm.

You should not confuse this with Evolution Strategies, which is one kind of evolution strategy for real-valued genes.

The strategy is distinguished from the population, as alternative strategies could be used for a population.

Definition at line 28 of file strategy.h.


Member Enumeration Documentation

enum traceflags
 

OStream flags for outputting some trace information.

Definition at line 71 of file strategy.h.


Constructor & Destructor Documentation

EAStrategy SimplePopulation   popula
 

Attaches the strategy to the given population.

The class currently supports only linear SimplePopulation.

Definition at line 60 of file population.cc.

References allow_same_parents, SimplePopulation::mElites, mpNextGen, mrPopula, and SimplePopulation::size().


Member Function Documentation

void addFeaturesTo Genome   genome const [virtual]
 

Adds strategy-dependent features to the given genome.

Definition at line 186 of file population.cc.

void check  
 

Implementation for Object.

Definition at line 210 of file population.cc.

References mpNextGen.

Referenced by SimplePopulation::check().

void evolve EAEnvironment   envr,
TextOStream &    out,
TextOStream &    log
 

Evolves a population to adapt to an environment.

Parameters:
envr  Environment where the population evolves in.
out  Output stream.
log  Logging stream for brief evolution logs.

Definition at line 86 of file population.cc.

References Individual::addking(), EAEnvironment::cycleReport(), Individual::evaluate(), SimplePopulation::evaluate(), SelectionSituation::getOrdered(), EAEnvironment::init_cycle(), SimplePopulation::mElites, mrPopula, recombine(), and SimplePopulation::report().

Referenced by SimplePopulation::evolve().

void print TextOStream &    out
 

Prints some strategic information to the given stream.

Definition at line 189 of file population.cc.

References MutationRate::binaryRate(), MutationRate::doubleRate(), MutationRate::doubleVariance(), MutationRate::intRate(), SimplePopulation::mElites, mrPopula, SelectionPrms::muFor(), SimplePopulation::mutRate(), SimplePopulation::selParams(), and SimplePopulation::size().

Referenced by SimplePopulation::SimplePopulation().

void recombine const SelectionSituation   situation,
const SelectionMatrix   selmat
 

Forms the next generation, usually by recombining parent individuals as offspring.

Parameters:
pop_order  The population of individuals in an array that is ordered according to their fitnesses.
selmat  Selection matrix that contains the pairwise selection probabilities for the potential pairs of parents. See SelectionMatrix for more information about selection.

Definition at line 125 of file population.cc.

References SelectionSituation::getOrdered(), SimplePopulation::mElites, mpNextGen, SimplePopulation::mpPopulation, mrPopula, SimplePopulation::mutRate(), SelectionMatrix::selectRandomPair(), and SimplePopulation::size().

Referenced by evolve().


Member Data Documentation

bool allow_same_parents [protected]
 

Mode flag dictating whether to allow self-breeding or not.

Definition at line 84 of file strategy.h.

Referenced by EAStrategy().

Array<Individual>* mpNextGen [protected]
 

An array holding the individuals of "next generation".

Definition at line 81 of file strategy.h.

Referenced by check(), EAStrategy(), and recombine().

SimplePopulation& mrPopula [protected]
 

The population that is being evolved with this strategy.

Definition at line 78 of file strategy.h.

Referenced by EAStrategy(), evolve(), print(), and recombine().


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 20:12:01 2005 for NeHeP by doxygen1.2.18