MultiTrials is a class that evaluate in more than one trial. More...
![Inheritance graph](classfarsa_1_1MultiTrials__inherit__graph.png)
Public Member Functions | |
MultiTrials (int steps=1, int trials=1) | |
Default Constructor. | |
virtual | ~MultiTrials () |
Destructor. | |
virtual MultiTrials * | clone () const =0 |
Create an exact copy of MultiTrials. | |
virtual void | configure (ConfigurationParameters ¶ms, 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 ¶ms, 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 | |
![]() | |
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. | |
GeneticAlgo * | GA () |
Return the GeneticAlgo used. | |
const GeneticAlgo * | GA () const |
Return the GeneticAlgo used (const version) | |
Genome * | genome () |
Return the Genome. | |
Genotype * | genotype () |
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. | |
![]() | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
virtual ParameterSettableUI * | getUIManager () |
ParameterSettable () | |
virtual void | postConfigureInitialization () |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
![]() | |
void | addObserver (RuntimeParameterObserver *obs) |
T | 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. | |
![]() | |
void | evaluationDone () |
Called by developers for signaling the end of Evaluation Process. | |
![]() | |
void | notifyChangesToParam (QString paramName) |
![]() | |
void | notifyChangesToParam (QString paramName) |
Additional Inherited Members | |
![]() | |
enum | Property |
![]() | |
AllowMultiple | |
Default | |
IsList | |
IsMandatory | |
![]() | |
static const double | Infinity |
static const int | MaxInteger |
static const int | MinInteger |
![]() | |
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().
|
virtual |
Destructor.
Definition at line 32 of file multitrials.cpp.
Member Function Documentation
|
pure virtual |
Create an exact copy of MultiTrials.
Implements Evaluation.
|
virtual |
Configure the object using the ConfigurationParameters specified.
- Parameters
-
params the object with configuration parameters prefix the 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.
|
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().
|
protectedpure virtual |
Called at the end of all trials for finalization.
|
protectedpure virtual |
Called at the start of Evaluation Process.
|
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
-
remain if true stops incrementing the current step counter
Definition at line 87 of file multitrials.cpp.
|
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.
|
virtual |
Save the actual status of parameters into the ConfigurationParameters object passed.
- Parameters
-
params the configuration parameters object on which save actual parameters prefix the 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().
|
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.
|
protectedpure virtual |
Called when Trial is finished.
|
protectedpure virtual |
Called for initialize the i-th trials.
- Parameters
-
trial is 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().
|
protectedpure virtual |
Called at each step of the evaluation process.
- Parameters
-
step is the counter of step done (it starts from zero) trial is the counter of trial to initialize (it starts from zero)
The documentation for this class was generated from the following files:
- ga/include/evaluations/multitrials.h
- ga/src/evaluations/multitrials.cpp