Modernized GAlib  3.0.0 current
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
GASteadyStateGA Class Reference

Steady-state genetic algorithm class. More...

#include <GASStateGA.h>

Inheritance diagram for GASteadyStateGA:
[legend]
Collaboration diagram for GASteadyStateGA:
[legend]

Public Member Functions

 GADefineIdentity ("GASteadyStateGA", GAID::SteadyStateGA)
 
 GASteadyStateGA (const GAGenome &)
 
 GASteadyStateGA (const GAPopulation &)
 
 GASteadyStateGA (const GASteadyStateGA &)
 
GASteadyStateGAoperator= (const GASteadyStateGA &)
 
void copy (const GAGeneticAlgorithm &) override
 
void initialize (unsigned int seed=0) override
 Undefined for the base class. More...
 
void step () override
 Evolve by one generation. More...
 
GASteadyStateGAoperator++ ()
 
int setptr (const std::string &name, const void *value) override
 
int get (const char *name, void *value) const override
 
int minimaxi () const override
 
int minimaxi (int m) override
 
const GAPopulationpopulation () const override
 
const GAPopulationpopulation (const GAPopulation &) override
 
int populationSize () const override
 
int populationSize (unsigned int n) override
 
GAScalingSchemescaling () const override
 
GAScalingSchemescaling (const GAScalingScheme &s) override
 
GASelectionSchemeselector () const override
 
GASelectionSchemeselector (const GASelectionScheme &s) override
 
void objectiveFunction (GAGenome::Evaluator f) override
 
void objectiveData (const GAEvalData &v) override
 
float pReplacement () const
 
float pReplacement (float p)
 
int nReplacement () const
 
int nReplacement (unsigned int n)
 
- Public Member Functions inherited from GAGeneticAlgorithm
 GADefineIdentity ("GAIncrementalGA", GAID::BaseGA)
 
 GAGeneticAlgorithm (const GAGenome &)
 
 GAGeneticAlgorithm (const GAPopulation &)
 
 GAGeneticAlgorithm (const GAGeneticAlgorithm &)
 
bool done ()
 Calls the completion measure routine to tell whether or not the GA is done.
 
virtual void evolve (unsigned int seed=0)
 This method is provided as a convenience so that you don't have to increment the GA generation-by-generation by hand. More...
 
virtual int write (const char *) const
 
virtual int write (std::ostream &) const
 
virtual int read (const char *)
 
virtual int read (std::istream &)
 
void * userData () const
 
void * userData (void *d)
 
Terminator terminator () const
 
Terminator terminator (Terminator f)
 
const GAParameterListparameters () const
 
const GAParameterListparameters (const GAParameterList &)
 
const GAParameterListparameters (int &, char **, bool flag=false)
 
const GAParameterListparameters (const std::string &filename, bool f=false)
 
const GAParameterListparameters (std::istream &, bool flag=false)
 
int set (const std::string &s, int v)
 
int set (const std::string &s, unsigned int v)
 
int set (const std::string &s, char v)
 
int set (const std::string &s, const char *v)
 
int set (const std::string &s, const void *v)
 
int set (const std::string &name, double v)
 
int minimize ()
 
int maximize ()
 
int nGenerations () const
 
int nGenerations (unsigned int n)
 
int nConvergence () const
 
int nConvergence (unsigned int n)
 
float pConvergence () const
 
float pConvergence (float p)
 
float pCrossover () const
 
float pCrossover (float p)
 
float pMutation () const
 
float pMutation (float p)
 
GAGenome::SexualCrossover crossover (GAGenome::SexualCrossover f)
 
GAGenome::SexualCrossover sexual () const
 
GAGenome::AsexualCrossover crossover (GAGenome::AsexualCrossover f)
 
GAGenome::AsexualCrossover asexual () const
 
const GAStatisticsstatistics () const
 
float convergence () const
 
int generation () const
 
void flushScores ()
 
int scoreFrequency () const
 
int scoreFrequency (unsigned int x)
 
int flushFrequency () const
 
int flushFrequency (unsigned int x)
 
std::string scoreFilename () const
 
std::string scoreFilename (const std::string &fn)
 
int selectScores ()
 
int selectScores (int w)
 
bool recordDiversity () const
 
bool recordDiversity (bool f)
 
virtual int nBestGenomes () const
 
virtual int nBestGenomes (unsigned int n)
 
- Public Member Functions inherited from GAID
bool sameClass (const GAID &b) const
 
virtual const char * className () const
 
virtual int classID () const
 

Static Public Member Functions

static GAParameterListregisterDefaultParameters (GAParameterList &)
 
- Static Public Member Functions inherited from GAGeneticAlgorithm
static GAParameterListregisterDefaultParameters (GAParameterList &)
 
static bool TerminateUponGeneration (GAGeneticAlgorithm &)
 
static bool TerminateUponConvergence (GAGeneticAlgorithm &)
 
static bool TerminateUponPopConvergence (GAGeneticAlgorithm &)
 

Protected Attributes

GAPopulationtmpPop
 
float pRepl
 
unsigned int nRepl
 
short which
 
- Protected Attributes inherited from GAGeneticAlgorithm
GAStatistics stats
 
GAParameterList params
 
GAPopulationpop
 
Terminator cf
 function for determining done-ness
 
void * ud
 pointer to user data structure
 
int d_seed
 
unsigned int ngen
 
unsigned int nconv
 
float pconv
 
float pcross
 
float pmut
 
int minmax
 
GAGenome::SexualCrossover scross
 sexual crossover to use
 
GAGenome::AsexualCrossover across
 asexual crossover to use
 

Additional Inherited Members

- Public Types inherited from GAGeneticAlgorithm
enum  { MINIMIZE = -1 , MAXIMIZE = 1 }
 
using Terminator = bool(*)(GAGeneticAlgorithm &)
 
- Public Types inherited from GAID
enum  {
  BaseGA = 0 , SimpleGA , SteadyStateGA , IncrementalGA ,
  DemeGA , Population = 10 , Scaling = 15 , NoScaling ,
  LinearScaling , SigmaTruncationScaling , PowerLawScaling , Sharing ,
  Selection = 40 , RankSelection , RouletteWheelSelection , TournamentSelection ,
  UniformSelection , SRSSelection , DSSelection , Genome = 50 ,
  BinaryStringGenome , BinaryStringGenome2D , BinaryStringGenome3D , Bin2DecGenome ,
  ListGenome , TreeGenome , ArrayGenome , ArrayGenome2D ,
  ArrayGenome3D , ArrayAlleleGenome , ArrayAlleleGenome2D , ArrayAlleleGenome3D ,
  StringGenome , FloatGenome , IntGenome , DoubleGenome
}
 

Detailed Description

Steady-state genetic algorithm class.

Member Function Documentation

◆ initialize()

void GASteadyStateGA::initialize ( unsigned int  seed = 0)
overridevirtual

Undefined for the base class.

The initialization routine typically calls the population initializer (which typically calls the genome initializers). It should also reset the statistics.

Implements GAGeneticAlgorithm.

◆ step()

void GASteadyStateGA::step ( )
overridevirtual

Evolve by one generation.

'generation' can be defined different ways for different genetic algorithms, but in the traditional formulation a generation mean creation of a new population (or portion thereof).

Implements GAGeneticAlgorithm.


The documentation for this class was generated from the following file: