|
Robot Simulator of the Robotics Group for Self-Organization of Control
0.8.0
|
This is the factory for the class Gen. More...
#include <SingletonGenFactory.h>
Public Member Functions | |
| Gen * | createGen (GenContext *context, Individual *individual, GenPrototype *prototype) const |
| random generation of a new gen. More... | |
| Gen * | createGen (GenContext *context, Individual *individual, GenPrototype *prototype, GenContext *oldContext, Individual *oldIndividual, Gen *oldGen, bool mutate=false) const |
| this function generate a new Gen by mutate a old Gen More... | |
| Gen * | createGen (GenContext *context, Individual *individual, GenPrototype *prototype, IValue *value) |
| create a new Gen by a giving value More... | |
| void | setNumber (int number) |
| set the member variable m_number to number More... | |
Static Public Member Functions | |
| static SingletonGenFactory * | getInstance (void) |
| this method is to become the only existing factory More... | |
| static void | destroyGenFactory (void) |
| this method is to destroy the one and only factory. More... | |
This is the factory for the class Gen.
It gives 3 Methodes to generate new gens. (random,value and mutation) Over this is the class as singleton concepted. Only one Factory for a run.
It use by every method the GenPrototype to be independent from the type of the Gen.
| Gen * createGen | ( | GenContext * | context, |
| Individual * | individual, | ||
| GenPrototype * | prototype | ||
| ) | const |
| Gen * createGen | ( | GenContext * | context, |
| Individual * | individual, | ||
| GenPrototype * | prototype, | ||
| GenContext * | oldContext, | ||
| Individual * | oldIndividual, | ||
| Gen * | oldGen, | ||
| bool | mutate = false |
||
| ) | const |
this function generate a new Gen by mutate a old Gen
| context | (GenContext*) the context of the new Gen |
| individual | (Individual*) the individual, where the gen is part of. |
| prototype | (GenPrototype*) the prototype of the gen, which should be create. |
| oldContext | (GenContext*) the Context of the old Gen |
| oldIndividual | (Individual*) the individua, where the olg gen is part of. |
| oldGen | (Gen*) the old Gen |
| mutate | (bool) should be mutate? |
| Gen * createGen | ( | GenContext * | context, |
| Individual * | individual, | ||
| GenPrototype * | prototype, | ||
| IValue * | value | ||
| ) |
|
inlinestatic |
this method is to destroy the one and only factory.
|
inlinestatic |
this method is to become the only existing factory
|
inline |
set the member variable m_number to number
| number | (int) the new value |