Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SingletonGenFactory Class Reference

This is the factory for the class Gen. More...

#include <SingletonGenFactory.h>

Public Member Functions

GencreateGen (GenContext *context, Individual *individual, GenPrototype *prototype) const
 random generation of a new gen. More...
 
GencreateGen (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...
 
GencreateGen (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 SingletonGenFactorygetInstance (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...
 

Detailed Description

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.

Member Function Documentation

Gen * createGen ( GenContext context,
Individual individual,
GenPrototype prototype 
) const

random generation of a new gen.

Parameters
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.
Returns
(Gen*) the 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

Parameters
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?
Returns
(Gen*) the new (or old gen)
Gen * createGen ( GenContext context,
Individual individual,
GenPrototype prototype,
IValue value 
)

create a new Gen by a giving value

Parameters
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.
value(IValue*) the value of the new gen
Returns
static void destroyGenFactory ( void  )
inlinestatic

this method is to destroy the one and only factory.

static SingletonGenFactory* getInstance ( void  )
inlinestatic

this method is to become the only existing factory

Returns
(SingletonGenFactory*) the one and only factory
void setNumber ( int  number)
inline

set the member variable m_number to number

Parameters
number(int) the new value

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