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
SingletonIndividualFactory Class Reference

this is a factory for the individual class. More...

#include <SingletonIndividualFactory.h>

Public Member Functions

Individual * createIndividual (std::string name=createName()) const
 random creation by random creation of Gen for every GenPrototype. More...
 
Individual * createIndividual (Individual *individual1, Individual *individual2, RandGen *random, std::string name=createName()) const
 create a new individual by recombination of the gens of there parents More...
 
void setNumber (int number)
 set the member variable m_number to number More...
 

Static Public Member Functions

static SingletonIndividualFactory * getInstance (void)
 this method gives the one and only existing factory back. More...
 
static void destroyFactory (void)
 destroy the only existing factory More...
 

Detailed Description

this is a factory for the individual class.

It use the SingletonGenFactory to create new individuals. It have 2 methods to create a individual. (random and recombination)

Over this is the class as singleton concepted. Only one Factory for a run.

Member Function Documentation

Individual * createIndividual ( std::string  name = createName()) const

random creation by random creation of Gen for every GenPrototype.

Parameters
name(string) the name of the new individual. Will be automaticly created
Returns
(Individual*) the new individual
Individual * createIndividual ( Individual *  individual1,
Individual *  individual2,
RandGen *  random,
std::string  name = createName() 
) const

create a new individual by recombination of the gens of there parents

Parameters
individual1(Individual*) parent 1
individual2(Individual*) parent 2
random(RandGen*) a random generator
name(string) the name of the new individual. Will be automaticly created
Returns
(Individual*) the new individual
static void destroyFactory ( void  )
inlinestatic

destroy the only existing factory

static SingletonIndividualFactory* getInstance ( void  )
inlinestatic

this method gives the one and only existing factory back.

Returns
(SingletonIndividualFactory*) the 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: