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

SIGEL_GP::SIG_GPFitnessTrainer Class Reference

This class controls the fitness computation tasks lauchned by PVM. More...

#include <SIG_GPFitnessTrainer.h>

List of all members.

Public Methods

 SIG_GPFitnessTrainer (SIG_GPExperiment& exp)
 The constructor of the object of a GPFitnesstrainer. More...

 ~SIG_GPFitnessTrainer ()
 The destructor of the an SIG_GPFitnessTrainer-object. More...

int spawnTask (SIG_GPIndividual const& ind)
 This operation spawns a PVM-task. More...

double checkTask (int task)
 This operation checks a PVM-task, if the computation continues or not. More...

void stopTrainersSlaves ()
 This operation will stop all PVM-tasks. More...

void sweepToSpawn ()
 This operation sweeps over the toSpawnArray, to evaluate which task is to start next. More...

int getNextHost ()

Private Attributes

SIG_GPExperimentexp
 A refernce to the actual experiment datas. More...

QVector< SIG_GPPVMTask > pvmTasks
 The array of TIDs from PVM, to identify the PVMtasks. More...

QVector< SIG_GPActivePVMHost > pvmHosts
int nextHostNumber
QList< QArray<int> > toSpawnList
 The array of indices, representing the position of the individual in the pool, which is to simulate. More...

SIG_GPPVMData PVMData
 This is an object of the class, which contains the data encode and decode routines, related to pvmdatatransfer. More...

SIGEL_Robot::SIG_Robot modifiedRobot
int nextFreeNumber
 This attribute contains the next free number, which is no indice in the array of the slaves. More...


Detailed Description

This class controls the fitness computation tasks lauchned by PVM.

Definition at line 22 of file SIG_GPFitnessTrainer.h.


Constructor & Destructor Documentation

SIGEL_GP::SIG_GPFitnessTrainer::SIG_GPFitnessTrainer ( SIGEL_GP::SIG_GPExperiment & exp )
 

The constructor of the object of a GPFitnesstrainer.

Precondition:
The GPManager is started and demands an object of the GPFItnessTrainer. A reference to an experiment object have to be given as a parameter.
Postcondition:
The object of a GPFitnessTrainer is created, the reference to the experiment object given as a parameter is set to the attributes. The QArrays are initialized with ZERO. The nextFreeNumber is set to ZERO.
Parameters:
exp   The actual experiment data of the GPManager.

Definition at line 8 of file SIG_GPFitnessTrainer.cpp.

SIGEL_GP::SIG_GPFitnessTrainer::~SIG_GPFitnessTrainer ( )
 

The destructor of the an SIG_GPFitnessTrainer-object.

Precondition:
The GPManager have to be destructed and the related classes have to be destructed first.
Postcondition:
The GPFitnessTrainer-object is destructed, no PVM-task is running anymore.

Definition at line 91 of file SIG_GPFitnessTrainer.cpp.


Member Function Documentation

double SIGEL_GP::SIG_GPFitnessTrainer::checkTask ( int taskId )
 

This operation checks a PVM-task, if the computation continues or not.

This happens by checking out the message buffer, which the checked PVM-task have to use. If the computation is completed, the operation will return the fitnessvalue of the evaluated robot controll programm. If it not, the negative value -1 is returned.

Precondition:
There is an PVM-task to check.
Postcondition:
If the desired data was placed in the message buffer, it is removed and forwarded to the individual. If not, nothing happened.
Parameters:
task   The TID of a PVM-task.
Returns:
The fitnessvalue of the evaluated robot controll programm or -1 as a sign that an error occured.

Definition at line 186 of file SIG_GPFitnessTrainer.cpp.

int SIGEL_GP::SIG_GPFitnessTrainer::getNextHost ( )
 

Definition at line 335 of file SIG_GPFitnessTrainer.cpp.

int SIGEL_GP::SIG_GPFitnessTrainer::spawnTask ( SIGEL_GP::SIG_GPIndividual const & ind )
 

This operation spawns a PVM-task.

The individual, given by the parameter, contains the robot control program, which is to evaluate.

Precondition:
The experiment attribute have to be set, because if not, there is no structure data, which is needed for the simulation run.
Postcondition:
The PVM_task is spawned computing the fitnessvalue of the robot controll programm, contained in the individual.
Parameters:
ind   The individual, which containes the robot controll programm.
Returns:
An integer, which represents the TID of the PVM-task. If an error occured at the spawning process, the returned integer has the value -1.

Definition at line 107 of file SIG_GPFitnessTrainer.cpp.

void SIGEL_GP::SIG_GPFitnessTrainer::stopTrainersSlaves ( )
 

This operation will stop all PVM-tasks.

Precondition:
There is a signal of an userbreak and the GPFitnessTrainer have to stop all computations of fitnessvalues.
Postcondition:
No PVM-task is running anymore.

Definition at line 236 of file SIG_GPFitnessTrainer.cpp.

void SIGEL_GP::SIG_GPFitnessTrainer::sweepToSpawn ( )
 

This operation sweeps over the toSpawnArray, to evaluate which task is to start next.

Precondition:
The toSpawnArray is not empty.
Postcondition:
The toSpawnArray is updated.

Definition at line 253 of file SIG_GPFitnessTrainer.cpp.


Member Data Documentation

SIG_GPPVMData SIGEL_GP::SIG_GPFitnessTrainer::PVMData [private]
 

This is an object of the class, which contains the data encode and decode routines, related to pvmdatatransfer.

Definition at line 54 of file SIG_GPFitnessTrainer.h.

SIG_GPExperiment & SIGEL_GP::SIG_GPFitnessTrainer::exp [private]
 

A refernce to the actual experiment datas.

Definition at line 28 of file SIG_GPFitnessTrainer.h.

SIGEL_Robot::SIG_Robot SIGEL_GP::SIG_GPFitnessTrainer::modifiedRobot [private]
 

Definition at line 57 of file SIG_GPFitnessTrainer.h.

int SIGEL_GP::SIG_GPFitnessTrainer::nextFreeNumber [private]
 

This attribute contains the next free number, which is no indice in the array of the slaves.

Definition at line 63 of file SIG_GPFitnessTrainer.h.

int SIGEL_GP::SIG_GPFitnessTrainer::nextHostNumber [private]
 

Definition at line 40 of file SIG_GPFitnessTrainer.h.

QVector< SIG_GPActivePVMHost > SIGEL_GP::SIG_GPFitnessTrainer::pvmHosts [private]
 

Definition at line 37 of file SIG_GPFitnessTrainer.h.

QVector< SIG_GPPVMTask > SIGEL_GP::SIG_GPFitnessTrainer::pvmTasks [private]
 

The array of TIDs from PVM, to identify the PVMtasks.

Definition at line 34 of file SIG_GPFitnessTrainer.h.

QList< QArray< int > > SIGEL_GP::SIG_GPFitnessTrainer::toSpawnList [private]
 

The array of indices, representing the position of the individual in the pool, which is to simulate.

Definition at line 46 of file SIG_GPFitnessTrainer.h.


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