jenes.stage
Class Evaluator<T extends Chromosome>

java.lang.Object
  extended by jenes.stage.AbstractStage<T>
      extended by jenes.stage.Evaluator<T>
Type Parameters:
T - The class chromosomes flowing across the stage.

public class Evaluator<T extends Chromosome>
extends AbstractStage<T>

This stage performs a population evaluation. In general, individuals that have been alread avaluated, do not require be evaluated again. However, in order to provide full control to the user, the class has the property force that if set, forces the evaluation of all individuals, despite the fact that the some individuals cold have been already evaluated.

Since:
1.0
Version:
1.3
Author:
Luigi Troiano

Field Summary
protected  boolean force
          The property controlling if evaluation should be extened also to individuals already evaluated.
 
Fields inherited from class jenes.stage.AbstractStage
biggerIsBetter, ga
 
Constructor Summary
Evaluator()
          Creates a new Evaluator instance.
Evaluator(boolean force)
          Creates a new Evaluator instance, specifying the value of force.
 
Method Summary
 boolean isForce()
          Returns the current value of force.
 void process(Population<T> in, Population<T> out)
          Performs an evaluation of input population.
 void setForce(boolean force)
          Sets the value of force.
 
Methods inherited from class jenes.stage.AbstractStage
dispose, init, isBiggerBetter, setBiggerIsBetter, setBiggerIsBetter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

force

protected boolean force
The property controlling if evaluation should be extened also to individuals already evaluated.

Constructor Detail

Evaluator

public Evaluator()
Creates a new Evaluator instance. By default force is false.


Evaluator

public Evaluator(boolean force)
Creates a new Evaluator instance, specifying the value of force.

Parameters:
force - - if true, all individuals are forced to be evaluated in any case.
Method Detail

isForce

public boolean isForce()
Returns the current value of force. By default this value is false.

Returns:
the value of force.

setForce

public void setForce(boolean force)
Sets the value of force.

Parameters:
force - - if true, all individuals are forced to be evaluated in any case.

process

public void process(Population<T> in,
                    Population<T> out)
             throws StageException
Performs an evaluation of input population.

Specified by:
process in class AbstractStage<T extends Chromosome>
Parameters:
in - - the input population.
out - - equals the input population
Throws:
StageException