Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

SIGEL_GP::SIG_GPIndividual Class Reference

This class realizes the GPIndividual object, which is needed as a container for the robot controll programm. More...

#include <SIG_GPIndividual.h>

List of all members.

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_ProgramgetProgramVar ()
 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_ProgramgetProgramPointer ()
 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...


Detailed Description

This class realizes the GPIndividual object, which is needed as a container for the robot controll programm.

Definition at line 26 of file SIG_GPIndividual.h.


Constructor & Destructor Documentation

SIGEL_GP::SIG_GPIndividual::SIG_GPIndividual ( )
 

The constructor of an individual, used for creating an empty individual.

Precondition:
There must be a pool to place the individual.
Postcondition:
The individual is created and it will contain no data.

Definition at line 75 of file SIG_GPIndividual.cpp.

SIGEL_GP::SIG_GPIndividual::SIG_GPIndividual ( SIG_GPParameter & param,
SIGEL_Tools::SIG_Randomizer & random,
QString name,
QDateTime birthtime,
int poolpos )
 

Definition at line 17 of file SIG_GPIndividual.cpp.

SIGEL_GP::SIG_GPIndividual::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.

Precondition:
There must be a pool to place the individual and a genetic operation occured.
Postcondition:
An individual object is created correctly and it is placed in the correct position of the pool. The history is composed of the birthtime and the constant reference to the history of the forefather.
Parameters:
param   The constant reference to the gp parameters, needed for the correct creation of the individual.
history   The history of the forefather.
name   The name of the individual, which is to be created.
birthtime   The birthtime of the created individual
poolpos   The position of the individual in the pool.

Definition at line 44 of file SIG_GPIndividual.cpp.

SIGEL_GP::SIG_GPIndividual::SIG_GPIndividual ( SIGEL_Tools::SIG_Randomizer & random )
 

The constructor of an individual that shall contain a randomly generated program.

Postcondition:
An individual is created randomly. This individual will contain a complete program.

Definition at line 83 of file SIG_GPIndividual.cpp.

SIGEL_GP::SIG_GPIndividual::SIG_GPIndividual ( SIGEL_Tools::SIG_Randomizer & random,
SIGEL_GP::SIG_GPParameter & param,
SIGEL_Robot::SIG_LanguageParameters & languageP )
 

Definition at line 108 of file SIG_GPIndividual.cpp.

SIGEL_GP::SIG_GPIndividual::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.

Precondition:
There is a pool object and the external robot control programm, which has to be inserted in the pool.
Postcondition:
The new individual is created with the external robot control programm and placed placed in the right position of the pool.
Parameters:
prog   The external robot control program.
name   The name of the new individual.
history   The history, which has to be added to the new individual.
birthtime   The birthtime of the new individual.
poolpos   The position in the pool, where the new individual has to be set.

SIGEL_GP::SIG_GPIndividual::SIG_GPIndividual ( QString data )
 

The constructor of an individual, used for initializing an individual with data from a Qstring, by loading an experiment.

Precondition:
There is individual data, encoded in a QString.
Postcondition:
The new individual is created from the data.
Parameters:
data   The data, which describes the individual, which is to create.

Definition at line 126 of file SIG_GPIndividual.cpp.

SIGEL_GP::SIG_GPIndividual::~SIG_GPIndividual ( )
 

The destructor of the GPIndividual.

Definition at line 131 of file SIG_GPIndividual.cpp.

SIGEL_GP::SIG_GPIndividual::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.

Definition at line 58 of file SIG_GPIndividual.cpp.


Member Function Documentation

void SIGEL_GP::SIG_GPIndividual::addCrossOverInfo ( QString name1,
QString name2,
QDateTime time,
int xoverpnt1,
int xoverpnt2,
double fitness1,
double fitness2 )
 

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.

void SIGEL_GP::SIG_GPIndividual::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.

Precondition:
A crossover of two robot control programs of two individual has occured.
Postcondition:
The information is added to the history of the considered individual.
Parameters:
name1   The name of the first individual which was involved in the crossover.
name2   The name of the second individual which was involved in the crossover.
time   The time when the crossover happened.
xoverpnt1   The crossover point of the first robot control programm
xoverpnt2   The crossoverpoint of the second robot control program.

Definition at line 321 of file SIG_GPIndividual.cpp.

Referenced by SIGEL_GP::SIG_GPOperations::crossOver().

void SIGEL_GP::SIG_GPIndividual::addImportIndividualInfo ( QDateTime time )
 

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().

void SIGEL_GP::SIG_GPIndividual::addImportProgramInfo ( QDateTime time )
 

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().

void SIGEL_GP::SIG_GPIndividual::addLengthDecreasedInfo ( QDateTime time,
long lgth )
 

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.

void SIGEL_GP::SIG_GPIndividual::addLengthIncreasedInfo ( QDateTime time,
long lgth )
 

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().

void SIGEL_GP::SIG_GPIndividual::addMutationInfo ( QString name,
QDateTime time,
int mutpoint,
double fit )
 

This function adds an information to the history.

Definition at line 300 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::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.

Precondition:
A mutation of the robot control program of the considered individual has occured.
Postcondition:
The information is added to the history.
Parameters:
name   The name of the individual.
time   The time of the occured mutation.
mutpoint   The mutation point, given as an integer.

Definition at line 280 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::addPreparationOfHistoryInfo ( )
 

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().

void SIGEL_GP::SIG_GPIndividual::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.

Precondition:
A reproduktion of the robot control program of the considered individual has occured.
Postcondition:
The information is added to the history.
Parameters:
name   The name of the individual.
time   The time of the occured mutation.

Definition at line 370 of file SIG_GPIndividual.cpp.

Referenced by SIGEL_GP::SIG_GPOperations::reproduction().

void SIGEL_GP::SIG_GPIndividual::copyIndividual ( SIGEL_GP::SIG_GPIndividual & cInd,
int poolPos )
 

This function copies an individual object and sets its position within the population.

Definition at line 222 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::exportIndividual ( QString & filename )
 

This function exports a complete individual to an existing file.

Definition at line 453 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::exportProgram ( QString & filename )
 

This function exports the program of the current individual to disk.

Definition at line 196 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::generateRandomIndividual ( SIGEL_Tools::SIG_Randomizer & random,
SIGEL_GP::SIG_GPParameter & param,
SIGEL_Robot::SIG_LanguageParameters & languageP )
 

Definition at line 141 of file SIG_GPIndividual.cpp.

long SIGEL_GP::SIG_GPIndividual::getAge ( ) const
 

This function returns the age of an individual.

Returns:
The age of the individual given as a integer.

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().

double SIGEL_GP::SIG_GPIndividual::getFitness ( ) const
 

This function returns the value of the fitness of the considered individual object.

Returns:
The fitness value of the considered individual given as a double.

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().

QStringList SIGEL_GP::SIG_GPIndividual::getHistory ( ) const
 

This function returns the history of the considered individual object.

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().

QString SIGEL_GP::SIG_GPIndividual::getName ( )
 

This function returns the name of an individual.

Returns:
The name of an individual, given as a QString.

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().

int SIGEL_GP::SIG_GPIndividual::getPoolPos ( ) const
 

This function returns the position of an individual in a pool.

Precondition:
There is a pool, containing the considered individual
Returns:
The position of the individual in the pool given by an integer.

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().

SIGEL_Program::SIG_Program const & SIGEL_GP::SIG_GPIndividual::getProgram ( ) const
 

This function returns the robot control program, whichs is part of the considered individual object.

Precondition:
There is an robot control program contained in the considered individual object.
Returns:
The robot control program contained in the considered individual object.

Definition at line 246 of file SIG_GPIndividual.cpp.

Referenced by SIGEL_GP::SIG_GPFitnessTrainer::spawnTask().

SIGEL_Program::SIG_Program * SIGEL_GP::SIG_GPIndividual::getProgramPointer ( )
 

This function returns a pointer to the program that is contained by the individual.

Returns:
The pointer (of the contained) program will be returned.

Definition at line 470 of file SIG_GPIndividual.cpp.

Referenced by readFromFile(), SIGEL_MasterGUI::SIG_AllIndividualsView::slotSelectionChanged(), and writeToFile().

SIGEL_Program::SIG_Program & SIGEL_GP::SIG_GPIndividual::getProgramVar ( )
 

This function returns the robot control program, whichs is part of the considered individual object, for modifications.

Precondition:
There is an robot control program contained in the considered individual object.
Returns:
The robot control program contained in the considered individual object.

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().

void SIGEL_GP::SIG_GPIndividual::importIndividual ( QString & filename )
 

This function imports a complete individual out of an existing file.

Definition at line 432 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::importProgram ( QString & filename )
 

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.

void SIGEL_GP::SIG_GPIndividual::importProgram ( SIGEL_Program::SIG_Program & prog )
 

This function imports a robot control program to individual.

Precondition:
There is an individual, with no robot control program or with one which can be overwrite.
Postcondition:
The individual contains the importet robot control program.
Parameters:
prog   The robot control program, which has to be importet to an individual.

Definition at line 185 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::increaseAge ( )
 

This function increases the age value of an individual at the end of an generation by one.

Precondition:
There must be a number of tournaments played, which defines the change of a generation.
Postcondition:
The age of the individual is increased by one.

Definition at line 168 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::increaseAgeInfo ( )
 

This function append new Information about the current increased Age of the individual to the History.

Postcondition:
A new Age is increased.

Definition at line 173 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::loadIndividual ( QString data )
 

This function loads an individual from a set of data which describes an complete individual.

Postcondition:
A new individual is created containing the data given by the parameter.
Parameters:
data   The data which describes an individual which has to be created.

Definition at line 207 of file SIG_GPIndividual.cpp.

Referenced by SIG_GPIndividual().

SIGEL_GP::SIG_GPIndividual & SIGEL_GP::SIG_GPIndividual::operator= ( SIGEL_GP::SIG_GPIndividual & ind )
 

This operator (I1=I2) copies an individual I2 into individual I1.

Postcondition:
I1 is equal to I2. I1 is a completely new individual, not only a further pointer to I2.

Definition at line 5 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::print ( )
 

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.

void SIGEL_GP::SIG_GPIndividual::readFromFile ( QString indStr )
 

This function reads an individual out of a QString.

Postcondition:
An individual is created as defined in the given QTextStream.

Definition at line 543 of file SIG_GPIndividual.cpp.

Referenced by importIndividual(), loadIndividual(), and SIGEL_GP::SIG_GPPopulation::readFromFile().

QString SIGEL_GP::SIG_GPIndividual::saveIndividual ( )
 

This function converts an individual object in a QString.

Returns:
A QString representing the values of the individual object and the returned QString can be used as a parameter for the loadIndividual function.

Definition at line 212 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::setAge ( long a )
 

This function sets the age of an individual.

Postcondition:
The individual's age is set to the given value.

Definition at line 475 of file SIG_GPIndividual.cpp.

Referenced by SIG_GPIndividual(), operator=(), and readFromFile().

void SIGEL_GP::SIG_GPIndividual::setAgeInfo ( )
 

This function append new Information about the current Age of the individual to the History.

Postcondition:
A new Age is set.

Definition at line 480 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::setFitness ( double fit )
 

With this function, the fitness value of a robot control program contained in the considered individual object, can be set.

Precondition:
There is a robot control program contained in the considered individual object, which is evalueted by an simulation run. Otherwise the fitness value is set to -1.
Postcondition:
The fitnessvalue of the considered individual is set to the value of the parameter.
Parameters:
fit   The value which has to be set to the fitnessvalue of the considered individual.

Definition at line 256 of file SIG_GPIndividual.cpp.

Referenced by SIG_GPIndividual(), operator=(), readFromFile(), and SIGEL_GP::SIG_GPOperations::reproduction().

void SIGEL_GP::SIG_GPIndividual::setFitnessInfo ( )
 

This function append new Information about the current Fitness Value of the individual to the History.

Postcondition:
A new Fitness is set.

Definition at line 261 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::setHistory ( QStringList hist )
 

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().

void SIGEL_GP::SIG_GPIndividual::setName ( QString n )
 

This function sets the name of an individual.

Postcondition:
The individual's name is set to the given string.

Definition at line 487 of file SIG_GPIndividual.cpp.

Referenced by SIG_GPIndividual(), operator=(), and readFromFile().

void SIGEL_GP::SIG_GPIndividual::setNameInfo ( )
 

This function append new Information about the current Name of the individual to the History.

Postcondition:
A new Name is set.

Definition at line 492 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::setPoolPos ( int pp )
 

This function sets the positions of an individual in the pool of individuals.

Postcondition:
The individual's pool position is set to the given value.

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().

void SIGEL_GP::SIG_GPIndividual::setPoolPosInfo ( )
 

This function append new Information about the current positions of the individual to the History.

Postcondition:
A new pool position is set.

Definition at line 239 of file SIG_GPIndividual.cpp.

bool SIGEL_GP::SIG_GPIndividual::upToDate ( ) const
 

With this function the status of the fitnessvalue of the individual can be checked.

Returns:
The answer of the questions:"Is the fitnessvalue up to date?".

Definition at line 426 of file SIG_GPIndividual.cpp.

void SIGEL_GP::SIG_GPIndividual::writeToFile ( QTextStream & file )
 

This function writes an individual to a QTextStream.

Postcondition:
The individual is written to the given QTextStream.

Definition at line 518 of file SIG_GPIndividual.cpp.

Referenced by exportIndividual(), saveIndividual(), and SIGEL_GP::SIG_GPPopulation::writeToFile().


Member Data Documentation

long SIGEL_GP::SIG_GPIndividual::age [private]
 

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.

double SIGEL_GP::SIG_GPIndividual::fitnessValue [private]
 

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.

QStringList SIGEL_GP::SIG_GPIndividual::history [private]
 

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.

QString SIGEL_GP::SIG_GPIndividual::indName [private]
 

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.

int SIGEL_GP::SIG_GPIndividual::poolPos [private]
 

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.

SIGEL_Program::SIG_Program SIGEL_GP::SIG_GPIndividual::prog [private]
 

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.


The documentation for this class was generated from the following files:
Generated at Mon Sep 3 01:32:44 2001 for PG 368 - SIGEL by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000