Evaluation Process Interface. More...

Inheritance diagram for Evaluation:

List of all members.

Public Member Functions

 Evaluation ()
 Default Constructor.
virtual ~Evaluation ()
 Destructor.
virtual Evaluationclone () const =0
 Create an exact copy of Evaluation.
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.
const GeneticAlgoGA () const
 Return the GeneticAlgo used (const version)
GeneticAlgoGA ()
 Return the GeneticAlgo used.
Genomegenome ()
 Return the Genome.
Genotypegenotype ()
 return the Genotype to Evaluate
unsigned int genotypeID ()
 Return the index of the Genotype into the Genome.
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.

Protected Member Functions

void evaluationDone ()
 Called by developers for signaling the end of Evaluation Process.
virtual void fini ()=0
 Re-implemented by Users for fit to own experiments.
virtual void init ()=0
 Re-implemented by Users for fit to own experiments.
virtual void step ()=0
 Re-implemented by Users for fit to own experiments.

Detailed Description

Evaluation Process Interface.

Description
Interface of the Evaluation Process Evalution Process consist of one or more steps for calculating the fitness of Genotype The Evaluation Process follow this schema:
  • set the Genotype which do you want calculate the fitness with setGenotype
  • call initialize (optional it will automatically at first step calls)
  • while( ! isEvaluationDone() ) call evaluateStep()
  • call finalize (optional it will automatically called when finish the evaluation
  • query the fitness with Genotype::fitness() method
Warnings

Definition at line 47 of file evaluation.h.


Constructor & Destructor Documentation

Default Constructor.

Definition at line 25 of file evaluation.cpp.

~Evaluation ( ) [virtual]

Destructor.

Definition at line 35 of file evaluation.cpp.


Member Function Documentation

virtual Evaluation* clone ( ) const [pure virtual]

Create an exact copy of Evaluation.

Implemented in MultiTrials.

void evaluate ( )

It evaluate the Genotype in a single-shot calling as many times as necessary evaluateStep.

Warning:
this is a blocking method

Definition at line 63 of file evaluation.cpp.

References Evaluation::evaluateStep(), and Evaluation::isEvaluationDone().

void evaluateStep ( )

Execute a single minor step and return.

Warning:
if you forget to initialize the Evaluation, this method will return a Fatal error blocking the execution of the application

Definition at line 55 of file evaluation.cpp.

References Evaluation::step().

Referenced by Evaluation::evaluate(), and StefanoSteadyStateGA::gaStep().

void evaluationDone ( ) [protected]

Called by developers for signaling the end of Evaluation Process.

Warning:
this does not automatically calls finalize()

Definition at line 83 of file evaluation.cpp.

void finalize ( )

Finalize the Evaluation Process.

Definition at line 69 of file evaluation.cpp.

References Evaluation::fini().

Referenced by StefanoSteadyStateGA::gaStep().

virtual void fini ( ) [protected, pure virtual]

Re-implemented by Users for fit to own experiments.

Referenced by Evaluation::finalize().

GeneticAlgo* GA ( ) [inline]

Return the GeneticAlgo used.

Definition at line 91 of file evaluation.h.

const GeneticAlgo* GA ( ) const [inline]

Return the GeneticAlgo used (const version)

Definition at line 95 of file evaluation.h.

Genome* genome ( ) [inline]

Return the Genome.

Definition at line 83 of file evaluation.h.

Referenced by Evaluation::initialize().

Genotype* genotype ( ) [inline]

return the Genotype to Evaluate

Definition at line 71 of file evaluation.h.

Referenced by StefanoSteadyStateGA::gaStep().

unsigned int genotypeID ( ) [inline]

Return the index of the Genotype into the Genome.

Definition at line 75 of file evaluation.h.

virtual void init ( ) [protected, pure virtual]

Re-implemented by Users for fit to own experiments.

Referenced by Evaluation::initialize().

void initialize ( Genotype genotypeToEvaluate)

Initialize the Evaluation Process.

Parameters:
genotypeToEvaluateis the Genotype to evaluate

Definition at line 39 of file evaluation.cpp.

References Genome::find(), Evaluation::genome(), and Evaluation::init().

Referenced by StefanoSteadyStateGA::gaStep().

bool isEvaluationDone ( )

return true if the Evaluation Process has finish

Definition at line 79 of file evaluation.cpp.

Referenced by Evaluation::evaluate(), and StefanoSteadyStateGA::gaStep().

virtual void step ( ) [protected, pure virtual]

Re-implemented by Users for fit to own experiments.

Referenced by Evaluation::evaluateStep().


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