SingletonIndividualFactory Class Reference

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

#include <SingletonIndividualFactory.h>

Collaboration diagram for SingletonIndividualFactory:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Static Public Member Functions

static SingletonIndividualFactorygetInstance (void)
 this method gives the one and only existing factory back.
static void destroyFactory (void)
 destroy the only existing factory

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 ( 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
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
static void destroyFactory ( void   )  [inline, static]

destroy the only existing factory

static SingletonIndividualFactory* getInstance ( void   )  [inline, static]

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:
Generated on Thu Jun 28 14:48:18 2012 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.6.3