State class - backbone of the framework. More...
#include <State.h>
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. |
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.
State::State | ( | ) |
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.
gen | new algorithm |
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.
gen | new genotype |
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.
gen | new operator |
bool State::initialize | ( | int | argc, | |
char ** | argv | |||
) |
bool State::run | ( | ) |
void State::setEvalOp | ( | EvaluateOpP | eval | ) |
Set user defined evaluation operator.
Evaluation operator must be created and set before the call to State::initialize
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
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.
genotype | new genotype to be included in each individual |