27 #ifndef SINGLETONINDIVIDUALFACTORY_H_
28 #define SINGLETONINDIVIDUALFACTORY_H_
31 #include <selforg/randomgenerator.h>
60 inline static void destroyFactory(
void) {
if(m_factory!=0){
delete m_factory; m_factory=NULL;}}
84 inline void setNumber(
int number) {m_number=number;}
113 inline static std::string createName(
void) {std::string s =
"Ind ";
char buffer[128];sprintf(buffer,
"%i",m_number);s+=buffer;
return s;}
void setNumber(int number)
set the member variable m_number to number
Definition: SingletonIndividualFactory.h:84
The Gen class.
Definition: Gen.h:51
Individual * createIndividual(std::string name=createName()) const
random creation by random creation of Gen for every GenPrototype.
Definition: SingletonIndividualFactory.cpp:47
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
static void destroyFactory(void)
destroy the only existing factory
Definition: SingletonIndividualFactory.h:60
this is a factory for the individual class.
Definition: SingletonIndividualFactory.h:46
The Generation class.
Definition: Generation.h:53
static SingletonIndividualFactory * getInstance(void)
this method gives the one and only existing factory back.
Definition: SingletonIndividualFactory.h:52
This class represent one individual of the complete gen.
Definition: Individual.h:45