#include <GLGeneticAlgorithmStandard.h>
Public Member Functions | |
GLGeneticAlgorithmStandard (const GLParametersGeneticAlgorithm ¶meters, GLFactory *factory) | |
virtual | ~GLGeneticAlgorithmStandard () |
virtual const GLBaseGaStatus * | getStatus () const |
const GLGaStatusStandard * | getStatusStandard () const |
virtual void | reset () |
virtual const GLBaseGaStatus * | runGA (GLBaseOrganismInitialiser *initialiser, GLBaseEvaluator *evaluator, const TListOfStoppers &stoppers, bool bool_operator=GLConstants::OR_OPERATOR) |
Definition at line 18 of file GLGeneticAlgorithmStandard.h.
GLGeneticAlgorithmStandard::GLGeneticAlgorithmStandard | ( | const GLParametersGeneticAlgorithm & | parameters, | |
GLFactory * | factory | |||
) |
Simple constructor.
parameters | parameters of the GA. Just passed to the BaseGA. | |
factory | factory to create GA elements (mutator, crossover etc.). |
Definition at line 16 of file GLGeneticAlgorithmStandard.cpp.
GLGeneticAlgorithmStandard::~GLGeneticAlgorithmStandard | ( | ) | [virtual] |
Destructor. Destroys everything.
Definition at line 27 of file GLGeneticAlgorithmStandard.cpp.
virtual const GLBaseGaStatus* GLGeneticAlgorithmStandard::getStatus | ( | ) | const [inline, virtual] |
Returns the current status of the genetic algorithm.
Implements GLBaseGeneticAlgorithm.
Definition at line 38 of file GLGeneticAlgorithmStandard.h.
const GLGaStatusStandard* GLGeneticAlgorithmStandard::getStatusStandard | ( | ) | const [inline] |
Returns the pointer to the status of the standard GA.
Definition at line 45 of file GLGeneticAlgorithmStandard.h.
void GLGeneticAlgorithmStandard::reset | ( | ) | [virtual] |
Resets the GA after run -- resets all it elements, cleans the population and the current status, frees memory occupied by organisms etc. Make the GA ready to run again. The current status after the call of this method is set to GA_STATE_INITIALISED. Be careful not to reset the GA while it is running.
Reimplemented from GLBaseGeneticAlgorithm.
Definition at line 39 of file GLGeneticAlgorithmStandard.cpp.
const GLBaseGaStatus * GLGeneticAlgorithmStandard::runGA | ( | GLBaseOrganismInitialiser * | initialiser, | |
GLBaseEvaluator * | evaluator, | |||
const TListOfStoppers & | stoppers, | |||
bool | bool_operator = GLConstants::OR_OPERATOR | |||
) | [virtual] |
Runs the GA.
initialiser | organism initialiser -- will determine which type of organism will be used for GA. Ideally it should allow to use the same exemplar of GA for solving entirely different problems by changing only initialiser and evaluator. | |
evaluator | class for evaluating the fitness function. | |
stoppers | list of stoppers which determine when the GA is to stop. | |
bool_operator | if == AND_OPERATOR then GA stops when ALL stoppers indicate that, when == OR_OPERATOR (default) then it happens when at least ONE of the stoppers is satisfied. |
Implements GLBaseGeneticAlgorithm.
Definition at line 61 of file GLGeneticAlgorithmStandard.cpp.