#include <SingletonGenFactory.h>
Collaboration diagram for SingletonGenFactory:
Public Member Functions | |
Gen * | createGen (GenContext *context, Individual *individual, GenPrototype *prototype) const |
random generation of a new gen. | |
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 | |
Gen * | createGen (GenContext *context, Individual *individual, GenPrototype *prototype, IValue *value) |
create a new Gen by a giving value | |
Static Public Member Functions | |
static SingletonGenFactory * | getInstance (void) |
this method is to become the only existing factory | |
static void | destroyGenFactory (void) |
this method is to destroy the one and only factory. |
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, | |||
IValue * | value | |||
) |
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 | |||
) | const |
static void destroyGenFactory | ( | void | ) | [inline, static] |
this method is to destroy the one and only factory.
static SingletonGenFactory* getInstance | ( | void | ) | [inline, static] |
this method is to become the only existing factory