#include <SingletonIndividualFactory.h>
Collaboration diagram for SingletonIndividualFactory:
Public Member Functions | |
Individual * | createIndividual (std::string name=createName()) const |
random creation by random creation of Gen for every GenPrototype. | |
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 | |
Static Public Member Functions | |
static SingletonIndividualFactory * | getInstance (void) |
this method gives the one and only existing factory back. | |
static void | destroyFactory (void) |
destroy the only existing factory |
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.
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
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 |
Individual * createIndividual | ( | std::string | name = createName() |
) | const |
random creation by random creation of Gen for every GenPrototype.
name | (string) the name of the new individual. Will be automaticly created |
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.