MultiTrials is a class that evaluate in more than one trial. More...

Inheritance diagram for MultiTrials:

Public Member Functions

 MultiTrials (int steps=1, int trials=1)
 Default Constructor.
 
virtual ~MultiTrials ()
 Destructor.
 
virtual MultiTrialsclone () const =0
 Create an exact copy of MultiTrials.
 
virtual void configure (ConfigurationParameters &params, QString prefix)
 Configure the object using the ConfigurationParameters specified.
 
int currentStep () const
 return the current step
 
int currentTrial () const
 return the current trial
 
virtual void save (ConfigurationParameters &params, QString prefix)
 Save the actual status of parameters into the ConfigurationParameters object passed.
 
void setSteps (int s)
 set the numbers of Step to do
 
void setTrials (int t)
 set the numbers of Trial to do
 
int steps () const
 return the numbers of Step
 
int trials () const
 return the numbers of trials
 
- Public Member Functions inherited from Evaluation
 Evaluation ()
 Default Constructor.
 
virtual ~Evaluation ()
 Destructor.
 
virtual void endGeneration (int generation)
 Called at the end of each generation.
 
void evaluate ()
 It evaluate the Genotype in a single-shot calling as many times as necessary evaluateStep.
 
void evaluateStep ()
 Execute a single minor step and return.
 
void finalize ()
 Finalize the Evaluation Process.
 
GeneticAlgoGA ()
 Return the GeneticAlgo used.
 
const GeneticAlgoGA () const
 Return the GeneticAlgo used (const version)
 
Genomegenome ()
 Return the Genome.
 
Genotypegenotype ()
 return the Genotype to Evaluate
 
unsigned int genotypeID ()
 Return the index of the Genotype into the Genome.
 
virtual void initGeneration (int generation)
 Called at the beginning of each generation.
 
void initialize (Genotype *genotypeToEvaluate)
 Initialize the Evaluation Process.
 
bool isEvaluationDone ()
 return true if the Evaluation Process has finish
 
void setGA (GeneticAlgo *g)
 Set the GeneticAlgo used.
 
void setGenome (Genome *g)
 Set the Genome where Genotypes lives.
 
- Public Member Functions inherited from ParameterSettableWithConfigureFunction
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
virtual ParameterSettableUIgetUIManager ()
 
 ParameterSettable ()
 
virtual void postConfigureInitialization ()
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 
- Public Member Functions inherited from ParameterSettable
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 

Static Public Member Functions

static void describe (QString type)
 Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
 

Protected Member Functions

virtual void mainFini ()=0
 Called at the end of all trials for finalization.
 
virtual void mainInit ()=0
 Called at the start of Evaluation Process.
 
void remainInCurrentStep (bool remain)
 Sets whether we should stop incrementing the current step counter or not.
 
bool remainingInCurrentStep () const
 Returns true if we are not incrementing the current step counter
See remainInCurrentStep() for more details.
 
void trialDone ()
 This method tell to MultiTrials that the current trial is ended.
 
virtual void trialFini (int trial)=0
 Called when Trial is finished.
 
virtual bool trialInit (int trial)=0
 Called for initialize the i-th trials.
 
virtual void trialStep (int step, int trial)=0
 Called at each step of the evaluation process.
 
- Protected Member Functions inherited from Evaluation
void evaluationDone ()
 Called by developers for signaling the end of Evaluation Process.
 
- Protected Member Functions inherited from ParameterSettableWithConfigureFunction
void notifyChangesToParam (QString paramName)
 
- Protected Member Functions inherited from ParameterSettable
void notifyChangesToParam (QString paramName)
 

Additional Inherited Members

- Public Types inherited from ParameterSettableWithConfigureFunction
enum  Property
 
- Public Attributes inherited from ParameterSettableWithConfigureFunction
 AllowMultiple
 
 Default
 
 IsList
 
 IsMandatory
 
- Static Public Attributes inherited from ParameterSettableWithConfigureFunction
static const double Infinity
 
static const int MaxInteger
 
static const int MinInteger
 
- Static Protected Member Functions inherited from ParameterSettableWithConfigureFunction
static Descriptor addTypeDescription (QString type, QString shortHelp, QString longHelp=QString(""))
 
static void setGraphicalEditor (QString type)
 

Detailed Description

MultiTrials is a class that evaluate in more than one trial.

Description
MultiTrials allow an easy way to implements fitnesses calculation based on more than one trials where each of them is composed of a maximum number of steps
Warnings

Definition at line 37 of file multitrials.h.

Constructor & Destructor Documentation

MultiTrials ( int  steps = 1,
int  trials = 1 
)

Default Constructor.

Definition at line 25 of file multitrials.cpp.

References MultiTrials::steps(), and MultiTrials::trials().

~MultiTrials ( )
virtual

Destructor.

Definition at line 32 of file multitrials.cpp.

Member Function Documentation

virtual MultiTrials* clone ( ) const
pure virtual

Create an exact copy of MultiTrials.

Implements Evaluation.

void configure ( ConfigurationParameters params,
QString  prefix 
)
virtual

Configure the object using the ConfigurationParameters specified.

Parameters
paramsthe object with configuration parameters
prefixthe group in which parameters are expected to be (this is terminated by a separator character). We expect to receive as prefix the group with evaluation parameters

Implements ParameterSettableWithConfigureFunction.

Definition at line 64 of file multitrials.cpp.

References ConfigurationParameters::getValue(), MultiTrials::setSteps(), MultiTrials::setTrials(), MultiTrials::steps(), and MultiTrials::trials().

int currentStep ( ) const

return the current step

Definition at line 56 of file multitrials.cpp.

int currentTrial ( ) const

return the current trial

Definition at line 44 of file multitrials.cpp.

void describe ( QString  type)
static

Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.

Definition at line 81 of file multitrials.cpp.

References ParameterSettableWithConfigureFunction::addTypeDescription(), ParameterSettable::Descriptor::describeInt(), ParameterSettable::IntDescriptor::help(), and ParameterSettable::IntDescriptor::limits().

virtual void mainFini ( )
protectedpure virtual

Called at the end of all trials for finalization.

virtual void mainInit ( )
protectedpure virtual

Called at the start of Evaluation Process.

void remainInCurrentStep ( bool  remain)
protected

Sets whether we should stop incrementing the current step counter or not.


If remain is true, the current step counter stops incrementing. This means that the trialStep function will be called at each step with the same step and trial parameters. Call with remain set to false to resume the current step counter increment at each step.

Parameters
remainif true stops incrementing the current step counter

Definition at line 87 of file multitrials.cpp.

bool remainingInCurrentStep ( ) const
protected

Returns true if we are not incrementing the current step counter
See remainInCurrentStep() for more details.

Returns
true if we are not incrementing the current step counter

Definition at line 92 of file multitrials.cpp.

void save ( ConfigurationParameters params,
QString  prefix 
)
virtual

Save the actual status of parameters into the ConfigurationParameters object passed.

Parameters
paramsthe configuration parameters object on which save actual parameters
prefixthe prefix to use to access the object configuration parameters.

Implements ParameterSettableWithConfigureFunction.

Definition at line 75 of file multitrials.cpp.

References ConfigurationParameters::createParameter(), MultiTrials::steps(), and MultiTrials::trials().

Referenced by LaralGA::save().

void setSteps ( int  s)

set the numbers of Step to do

Definition at line 48 of file multitrials.cpp.

Referenced by MultiTrials::configure().

void setTrials ( int  t)

set the numbers of Trial to do

Definition at line 36 of file multitrials.cpp.

Referenced by MultiTrials::configure().

int steps ( ) const

return the numbers of Step

Definition at line 52 of file multitrials.cpp.

Referenced by MultiTrials::configure(), MultiTrials::MultiTrials(), and MultiTrials::save().

void trialDone ( )
protected

This method tell to MultiTrials that the current trial is ended.


Called before reaching of the maximum steps allowed (setSteps) means a premature interruption of Trial for some reasons (task achieved, penalty, etc)

Definition at line 60 of file multitrials.cpp.

virtual void trialFini ( int  trial)
protectedpure virtual

Called when Trial is finished.

virtual bool trialInit ( int  trial)
protectedpure virtual

Called for initialize the i-th trials.

Parameters
trialis the counter of trial to initialize (it starts from zero)
Returns
the implementation should return true when initialisation has been done, otherwise the method will be called until it returns false; this is helpful for initialisation that need more that one step to be done
int trials ( ) const

return the numbers of trials

Definition at line 40 of file multitrials.cpp.

Referenced by MultiTrials::configure(), MultiTrials::MultiTrials(), and MultiTrials::save().

virtual void trialStep ( int  step,
int  trial 
)
protectedpure virtual

Called at each step of the evaluation process.

Parameters
stepis the counter of step done (it starts from zero)
trialis the counter of trial to initialize (it starts from zero)

The documentation for this class was generated from the following files: