#include <SIG_GPIndividual.h>
Public Methods | |
SIG_GPIndividual () | |
The constructor of an individual, used for creating an empty individual. More... | |
SIG_GPIndividual ( SIG_GPParameter& param, SIGEL_Tools::SIG_Randomizer& random, QString name, QDateTime birthtime, int poolpos ) | |
SIG_GPIndividual ( SIG_GPParameter const& param, QStringList const& hist, QString name, QDateTime birthtime, int poolpos ) | |
The constructor of an individual, used for the creation of an individual after a genetic operation. More... | |
SIG_GPIndividual ( SIGEL_Tools::SIG_Randomizer& random ) | |
The constructor of an individual that shall contain a randomly generated program. More... | |
SIG_GPIndividual ( SIGEL_Tools::SIG_Randomizer &random, SIGEL_GP::SIG_GPParameter& param, SIGEL_Robot::SIG_LanguageParameters& languageP ) | |
SIG_GPIndividual ( SIGEL_Program::SIG_Program const& prog, QString name, QString hist, QDateTime birthtime, int poolpos ) | |
The constructor of an individual, used for adding an individual to the pool, with a special robot control program from an external data store. More... | |
SIG_GPIndividual (QString data) | |
The constructor of an individual, used for initializing an individual with data from a Qstring, by loading an experiment. More... | |
~SIG_GPIndividual () | |
The destructor of the GPIndividual. More... | |
void | increaseAge () |
This function increases the age value of an individual at the end of an generation by one. More... | |
long | getAge () const |
This function returns the age of an individual. More... | |
void | importProgram (SIGEL_Program::SIG_Program& prog ) |
This function imports a robot control program to individual. More... | |
QString | getName () |
This function returns the name of an individual. More... | |
void | loadIndividual (QString data) |
This function loads an individual from a set of data which describes an complete individual. More... | |
QString | saveIndividual () |
This function converts an individual object in a QString. More... | |
void | copyIndividual (SIGEL_GP::SIG_GPIndividual &cInd,int poolPos) |
This function copies an individual object and sets its position within the population. More... | |
int | getPoolPos () const |
This function returns the position of an individual in a pool. More... | |
SIGEL_Program::SIG_Program const& | getProgram () const |
This function returns the robot control program, whichs is part of the considered individual object. More... | |
SIGEL_Program::SIG_Program& | getProgramVar () |
This function returns the robot control program, whichs is part of the considered individual object, for modifications. More... | |
void | setFitness (double fit) |
With this function, the fitness value of a robot control program contained in the considered individual object, can be set. More... | |
double | getFitness () const |
This function returns the value of the fitness of the considered individual object. More... | |
QStringList | getHistory () const |
This function returns the history of the considered individual object. More... | |
void | addMutationInfo (QString name, QDateTime time, int mutpoint) |
This function adds informations about the mutation of the robot control program of the considered individual object to the object. More... | |
void | addMutationInfo (QString name, QDateTime time, int mutpoint, double fit) |
This function adds an information to the history. More... | |
void | addCrossOverInfo (QString name1, QString name2, QDateTime time, int xoverpnt1, int xoverpnt2) |
This function adds informations about the crossover of two robot control programs, of two individual objects to one of them. More... | |
void | addCrossOverInfo (QString name1, QString name2, QDateTime time, int xoverpnt1, int xoverpnt2, double fitness1, double fitness2 ) |
This function adds the crossover information to the history. More... | |
void | addLengthIncreasedInfo ( QDateTime time, long lgth ) |
This function will add an info to the history if the program length needed to be increased, e.g. More... | |
void | addLengthDecreasedInfo ( QDateTime time, long lgth ) |
This function will add an info to the history if the program length needed to be decreased, e.g. More... | |
SIG_GPIndividual ( SIGEL_Program::SIG_Program const& prog, QString name1, QString name2, QString name3, QDateTime birthtime, int poolpos, QStringList const& hist ) | |
This constructor imports a program PROG while it is initializing the individual. More... | |
void | addReproductionInfo (QString name, QDateTime time) |
This function adds information about the reproduction of the robot control program of the considered individual object to the object. More... | |
void | addImportIndividualInfo (QDateTime time) |
This function adds an information to the history about the import of a complete individual. More... | |
void | addImportProgramInfo (QDateTime time) |
This function adds an information to the history about the import of a new program. More... | |
void | addPreparationOfHistoryInfo () |
This function prepares the history for an import entry. More... | |
bool | upToDate () const |
With this function the status of the fitnessvalue of the individual can be checked. More... | |
SIGEL_Program::SIG_Program* | getProgramPointer () |
This function returns a pointer to the program that is contained by the individual. More... | |
void | setPoolPos (int pp) |
This function sets the positions of an individual in the pool of individuals. More... | |
void | setAge (long a) |
This function sets the age of an individual. More... | |
void | setName (QString n) |
This function sets the name of an individual. More... | |
void | writeToFile (QTextStream &file) |
This function writes an individual to a QTextStream. More... | |
void | readFromFile (QString indStr) |
This function reads an individual out of a QString. More... | |
SIGEL_GP::SIG_GPIndividual& | operator= (SIGEL_GP::SIG_GPIndividual& ind) |
This operator (I1=I2) copies an individual I2 into individual I1. More... | |
void | generateRandomIndividual (SIGEL_Tools::SIG_Randomizer& random, SIGEL_GP::SIG_GPParameter& param, SIGEL_Robot::SIG_LanguageParameters& languageP) |
void | increaseAgeInfo () |
This function append new Information about the current increased Age of the individual to the History. More... | |
void | setFitnessInfo () |
This function append new Information about the current Fitness Value of the individual to the History. More... | |
void | setPoolPosInfo () |
This function append new Information about the current positions of the individual to the History. More... | |
void | setAgeInfo () |
This function append new Information about the current Age of the individual to the History. More... | |
void | setNameInfo () |
This function append new Information about the current Name of the individual to the History. More... | |
void | importIndividual ( QString& filename ) |
This function imports a complete individual out of an existing file. More... | |
void | exportIndividual ( QString& filename ) |
This function exports a complete individual to an existing file. More... | |
void | print () |
This function is only for test purposes and prints the current individual's data to stderr. More... | |
void | importProgram ( QString& filename ) |
This function imports a program from a file. More... | |
void | exportProgram ( QString& filename ) |
This function exports the program of the current individual to disk. More... | |
void | setHistory ( QStringList hist ) |
This function sets the history of the current individual to the given one. More... | |
Private Attributes | |
long | age |
The age of an individal, which depends on the time, counted by the number of played tournaments, an individual is still a poolmember. More... | |
QStringList | history |
The history of an individual, described in this QStringList. More... | |
SIGEL_Program::SIG_Program | prog |
The robot controll program, which is the created and modified randomly by the genetic operations. More... | |
QString | indName |
The Name of an individual. More... | |
int | poolPos |
This attribute holds the position of the individual in the data structure of the individuals pool. More... | |
double | fitnessValue |
This attribute holds the fitnessvalue of the robot controll programm. More... |
Definition at line 26 of file SIG_GPIndividual.h.
|
The constructor of an individual, used for creating an empty individual.
Definition at line 75 of file SIG_GPIndividual.cpp. |
|
Definition at line 17 of file SIG_GPIndividual.cpp. |
|
The constructor of an individual, used for the creation of an individual after a genetic operation.
Definition at line 44 of file SIG_GPIndividual.cpp. |
|
The constructor of an individual that shall contain a randomly generated program.
Definition at line 83 of file SIG_GPIndividual.cpp. |
|
Definition at line 108 of file SIG_GPIndividual.cpp. |
|
The constructor of an individual, used for adding an individual to the pool, with a special robot control program from an external data store.
|
|
The constructor of an individual, used for initializing an individual with data from a Qstring, by loading an experiment.
Definition at line 126 of file SIG_GPIndividual.cpp. |
|
The destructor of the GPIndividual.
Definition at line 131 of file SIG_GPIndividual.cpp. |
|
This constructor imports a program PROG while it is initializing the individual.
Definition at line 58 of file SIG_GPIndividual.cpp. |
|
This function adds the crossover information to the history. This function also presents the fitness value of the parents, which genetic materials have been recombined. Definition at line 345 of file SIG_GPIndividual.cpp. |
|
This function adds informations about the crossover of two robot control programs, of two individual objects to one of them.
Definition at line 321 of file SIG_GPIndividual.cpp. Referenced by SIGEL_GP::SIG_GPOperations::crossOver(). |
|
This function adds an information to the history about the import of a complete individual.
Definition at line 396 of file SIG_GPIndividual.cpp. Referenced by importIndividual(). |
|
This function adds an information to the history about the import of a new program.
Definition at line 402 of file SIG_GPIndividual.cpp. Referenced by importProgram(). |
|
This function will add an info to the history if the program length needed to be decreased, e.g. in case of an imported program. Definition at line 417 of file SIG_GPIndividual.cpp. |
|
This function will add an info to the history if the program length needed to be increased, e.g. in case of an imported program. Definition at line 409 of file SIG_GPIndividual.cpp. Referenced by SIGEL_GP::SIG_GPOperations::crossOver(), and SIGEL_GP::SIG_GPOperations::reproduction(). |
|
This function adds an information to the history.
Definition at line 300 of file SIG_GPIndividual.cpp. |
|
This function adds informations about the mutation of the robot control program of the considered individual object to the object.
Definition at line 280 of file SIG_GPIndividual.cpp. |
|
This function prepares the history for an import entry. If this preparation is not made, an import is difficult to recognize within the history data. Definition at line 388 of file SIG_GPIndividual.cpp. Referenced by importIndividual(). |
|
This function adds information about the reproduction of the robot control program of the considered individual object to the object.
Definition at line 370 of file SIG_GPIndividual.cpp. Referenced by SIGEL_GP::SIG_GPOperations::reproduction(). |
|
This function copies an individual object and sets its position within the population.
Definition at line 222 of file SIG_GPIndividual.cpp. |
|
This function exports a complete individual to an existing file.
Definition at line 453 of file SIG_GPIndividual.cpp. |
|
This function exports the program of the current individual to disk.
Definition at line 196 of file SIG_GPIndividual.cpp. |
|
Definition at line 141 of file SIG_GPIndividual.cpp. |
|
This function returns the age of an individual.
Definition at line 180 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(), addCrossOverInfo(), addMutationInfo(), addReproductionInfo(), increaseAgeInfo(), print(), setAgeInfo(), setNameInfo(), SIGEL_MasterGUI::SIG_IndividualListItem::setTo(), SIGEL_MasterGUI::SIG_AllIndividualsView::slotSelectionChanged(), and writeToFile(). |
|
This function returns the value of the fitness of the considered individual object.
Definition at line 269 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(), addCrossOverInfo(), addMutationInfo(), addReproductionInfo(), SIGEL_GP::SIG_GPOperations::crossOver(), SIGEL_GP::SIG_GPPopulation::getBestFitness(), SIGEL_GP::SIG_GPOperations::mutation(), print(), SIGEL_GP::SIG_GPOperations::reproduction(), setFitnessInfo(), SIGEL_MasterGUI::SIG_IndividualListItem::setTo(), SIGEL_MasterGUI::SIG_AllIndividualsView::slotSelectionChanged(), and writeToFile(). |
|
This function returns the history of the considered individual object.
Definition at line 274 of file SIG_GPIndividual.cpp. Referenced by SIGEL_GP::SIG_GPOperations::crossOver(), SIGEL_GP::SIG_GPOperations::mutation(), SIGEL_GP::SIG_GPOperations::reproduction(), and SIGEL_MasterGUI::SIG_AllIndividualsView::slotSelectionChanged(). |
|
This function returns the name of an individual.
Definition at line 202 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(), SIGEL_GP::SIG_GPOperations::crossOver(), SIGEL_GP::SIG_GPOperations::mutation(), print(), SIGEL_GP::SIG_GPOperations::reproduction(), SIGEL_MasterGUI::SIG_IndividualListItem::setTo(), SIGEL_MasterGUI::SIG_AllIndividualsView::slotSelectionChanged(), and writeToFile(). |
|
This function returns the position of an individual in a pool.
Definition at line 229 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(), addCrossOverInfo(), addMutationInfo(), addReproductionInfo(), print(), setPoolPosInfo(), SIGEL_MasterGUI::SIG_IndividualListItem::setTo(), SIGEL_GP::SIG_GPFitnessTrainer::spawnTask(), and writeToFile(). |
|
This function returns the robot control program, whichs is part of the considered individual object.
Definition at line 246 of file SIG_GPIndividual.cpp. Referenced by SIGEL_GP::SIG_GPFitnessTrainer::spawnTask(). |
|
This function returns a pointer to the program that is contained by the individual.
Definition at line 470 of file SIG_GPIndividual.cpp. Referenced by readFromFile(), SIGEL_MasterGUI::SIG_AllIndividualsView::slotSelectionChanged(), and writeToFile(). |
|
This function returns the robot control program, whichs is part of the considered individual object, for modifications.
Definition at line 251 of file SIG_GPIndividual.cpp. Referenced by SIGEL_GP::SIG_GPOperations::crossOver(), exportProgram(), importProgram(), SIGEL_GP::SIG_GPOperations::mutation(), operator=(), print(), SIGEL_GP::SIG_GPOperations::reproduction(), and SIGEL_MasterGUI::SIG_AllIndividualsView::slotVisualize(). |
|
This function imports a complete individual out of an existing file.
Definition at line 432 of file SIG_GPIndividual.cpp. |
|
This function imports a program from a file. An already existing program will be replaced by the loaded one. Definition at line 190 of file SIG_GPIndividual.cpp. |
|
This function imports a robot control program to individual.
Definition at line 185 of file SIG_GPIndividual.cpp. |
|
This function increases the age value of an individual at the end of an generation by one.
Definition at line 168 of file SIG_GPIndividual.cpp. |
|
This function append new Information about the current increased Age of the individual to the History.
Definition at line 173 of file SIG_GPIndividual.cpp. |
|
This function loads an individual from a set of data which describes an complete individual.
Definition at line 207 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(). |
|
This operator (I1=I2) copies an individual I2 into individual I1.
Definition at line 5 of file SIG_GPIndividual.cpp. |
|
This function is only for test purposes and prints the current individual's data to stderr.
Definition at line 500 of file SIG_GPIndividual.cpp. |
|
This function reads an individual out of a QString.
Definition at line 543 of file SIG_GPIndividual.cpp. Referenced by importIndividual(), loadIndividual(), and SIGEL_GP::SIG_GPPopulation::readFromFile(). |
|
This function converts an individual object in a QString.
Definition at line 212 of file SIG_GPIndividual.cpp. |
|
This function sets the age of an individual.
Definition at line 475 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(), operator=(), and readFromFile(). |
|
This function append new Information about the current Age of the individual to the History.
Definition at line 480 of file SIG_GPIndividual.cpp. |
|
With this function, the fitness value of a robot control program contained in the considered individual object, can be set.
Definition at line 256 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(), operator=(), readFromFile(), and SIGEL_GP::SIG_GPOperations::reproduction(). |
|
This function append new Information about the current Fitness Value of the individual to the History.
Definition at line 261 of file SIG_GPIndividual.cpp. |
|
This function sets the history of the current individual to the given one. This function is only used in combination with genetic operators. Definition at line 538 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(). |
|
This function sets the name of an individual.
Definition at line 487 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(), operator=(), and readFromFile(). |
|
This function append new Information about the current Name of the individual to the History.
Definition at line 492 of file SIG_GPIndividual.cpp. |
|
This function sets the positions of an individual in the pool of individuals.
Definition at line 234 of file SIG_GPIndividual.cpp. Referenced by SIG_GPIndividual(), SIGEL_GP::SIG_GPPopulation::SIG_GPPopulation(), SIGEL_GP::SIG_GPPopulation::addRandomIndividuals(), copyIndividual(), SIGEL_GP::SIG_GPPopulation::deleteIndividual(), operator=(), and readFromFile(). |
|
This function append new Information about the current positions of the individual to the History.
Definition at line 239 of file SIG_GPIndividual.cpp. |
|
With this function the status of the fitnessvalue of the individual can be checked.
Definition at line 426 of file SIG_GPIndividual.cpp. |
|
This function writes an individual to a QTextStream.
Definition at line 518 of file SIG_GPIndividual.cpp. Referenced by exportIndividual(), saveIndividual(), and SIGEL_GP::SIG_GPPopulation::writeToFile(). |
|
The age of an individal, which depends on the time, counted by the number of played tournaments, an individual is still a poolmember.
Definition at line 33 of file SIG_GPIndividual.h. |
|
This attribute holds the fitnessvalue of the robot controll programm. At the initialization the value is -1 to show that the fitnessvalue is not actual. The fitnessvalue has no max value. Definition at line 70 of file SIG_GPIndividual.h. |
|
The history of an individual, described in this QStringList. Every event-operation adds a string to the history. For detailed describtion see below. Definition at line 40 of file SIG_GPIndividual.h. |
|
The Name of an individual. The name is created by taking parts from the name of the experiment, the name of the robot and an continuous number. Definition at line 54 of file SIG_GPIndividual.h. |
|
This attribute holds the position of the individual in the data structure of the individuals pool.
Definition at line 61 of file SIG_GPIndividual.h. |
|
The robot controll program, which is the created and modified randomly by the genetic operations. Its definition is placed in the SIG-Program class. Definition at line 47 of file SIG_GPIndividual.h. |