Public Member Functions

State Class Reference
[Evolutionary FrameworkMain Classes]

State class - backbone of the framework. More...

#include <State.h>

List of all members.

Public Member Functions

 State ()
 Construct the one and only State object.
bool initialize (int, char **)
 Initialize the whole system.
bool run ()
 Driver of the evolution process - serial version.
FitnessP getFitnessObject ()
 get one initial Fitness object (create on demand)
RandomizerP getRandomizer ()
 get current Randomizer
void setRandomizer (RandomizerP randomizer)
 set Randomizer to be used
RegistryP getRegistry ()
 get access to parameter repository
LoggerP getLogger ()
 get Logger
StatCalcP getStats ()
 get population statistics
HallOfFameP getHoF ()
 get population hall of fame
CommunicatorP getCommunicator ()
 access current process communicator mechanism
uint getGenerationNo ()
 get current generation number
uint getElapsedTime ()
 get elapsed time (in seconds)
bool getBatchMode ()
 get batch mode info (yes or no)
void setTerminateCond ()
 set termination condition (evolution ends with current generation)
uint increaseEvaluations (uint nEval=1)
 increase and return number of evaluations (local deme)
uint getEvaluations ()
 get number of evaluations (global population)
bool getTerminateCond ()
 is termination condition set
EvolutionContextP getContext ()
 get evolutionary context
IndividualP getIndividualObject ()
 get one initial Individual object
std::vector< GenotypeP > getGenotypes ()
 access all active (currently used) genotypes
PopulationP getPopulation ()
 get Population
AlgorithmP getAlgorithm ()
 access current active Algorithm
EvaluateOpP getEvalOp ()
 access evaluation operator
bool isImplicitParallel ()
 Is the algorithm executed implicitly parallel.
bool isAlgorithmParallel ()
 Is current algorithm parallel.
uint setGenotype (GenotypeP)
 Set a genotype to be used in individuals.
void setAlgorithm (AlgorithmP)
 Set the desired algorithm (overrides the current choice).
void setEvalOp (EvaluateOpP)
 Set user defined evaluation operator.
void setEvalOp (EvaluateOp *)
 Set user defined evaluation operator (without a smart pointer).
bool addGenotype (GenotypeP gen)
 Add user-defined or user customized genotype. (The genotype can then be specified and used in config file.) Replaces the existing genotype with the same name (if there is one). Must be called before State::initialize.
bool addAlgorithm (AlgorithmP alg)
 Add user-defined or user customized algorithm. (It can then be specified and used in config file.) Replaces the existing algorithm with the same name (if there is one). Must be called before State::initialize.
bool addOperator (OperatorP op)
 Add user-defined operator. (Its parameters can now be specified and used in config file.) Must be called before State::initialize.

Detailed Description

State class - backbone of the framework.

State class handles user communication, component repository and evolution process. State is also the entry point for access to system parameters and functionality.

Definition at line 38 of file State.h.


Constructor & Destructor Documentation

State::State (  ) 

Construct the one and only State object.

Also register all known algorithms, genotypes and termination operators, create the population and some other elements of the system.

Definition at line 12 of file State.cpp.


Member Function Documentation

bool State::addAlgorithm ( AlgorithmP  alg  ) 

Add user-defined or user customized algorithm. (It can then be specified and used in config file.) Replaces the existing algorithm with the same name (if there is one). Must be called before State::initialize.

Parameters:
gen new algorithm

Definition at line 999 of file State.cpp.

bool State::addGenotype ( GenotypeP  gen  ) 

Add user-defined or user customized genotype. (The genotype can then be specified and used in config file.) Replaces the existing genotype with the same name (if there is one). Must be called before State::initialize.

Parameters:
gen new genotype

Definition at line 984 of file State.cpp.

bool State::addOperator ( OperatorP  op  ) 

Add user-defined operator. (Its parameters can now be specified and used in config file.) Must be called before State::initialize.

Parameters:
gen new operator

Definition at line 1012 of file State.cpp.

bool State::initialize ( int  argc,
char **  argv 
)

Initialize the whole system.

Initialization steps:

  • parse command line arguments
  • register parameters of framework components
  • parse config file
  • initialize all components. Called by: main

Definition at line 693 of file State.cpp.

bool State::run (  ) 

Driver of the evolution process - serial version.

Driver of the evolution process - parallel version.

Runs the designated algorithm. Called by: main()

Definition at line 1031 of file State.cpp.

void State::setEvalOp ( EvaluateOpP  eval  ) 

Set user defined evaluation operator.

Evaluation operator must be created and set before the call to State::initialize

Definition at line 953 of file State.cpp.

void State::setEvalOp ( EvaluateOp eval  ) 

Set user defined evaluation operator (without a smart pointer).

Evaluation operator must be created and set before the call to State::initialize

Definition at line 965 of file State.cpp.

uint State::setGenotype ( GenotypeP  genotype  ) 

Set a genotype to be used in individuals.

This actually adds new gentoype to be used in individuals (doesn't replace the ones already defined as active). Each genotype is given a unique index.

Parameters:
genotype new genotype to be included in each individual
Returns:
new genotype's index

Definition at line 914 of file State.cpp.


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