org.opt4j.core.common.completer
Class SequentialIndividualCompleter

java.lang.Object
  extended by org.opt4j.core.common.completer.SequentialIndividualCompleter
All Implemented Interfaces:
IndividualCompleter
Direct Known Subclasses:
ParallelIndividualCompleter

public class SequentialIndividualCompleter
extends java.lang.Object
implements IndividualCompleter

The SequentialIndividualCompleter completes the Individuals sequentially.

It updates the Individual.State of the Individual according to the state of the completion process. It uses Control between the different (possibly time consuming) completion steps to allow the user to control the completion process.


Field Summary
protected  Control control
           
protected  Decoder<Genotype,java.lang.Object> decoder
           
protected  Evaluator<java.lang.Object> evaluator
           
 
Constructor Summary
SequentialIndividualCompleter(Control control, Decoder<Genotype,java.lang.Object> decoder, Evaluator<java.lang.Object> evaluator)
          Constructs a SequentialIndividualCompleter.
 
Method Summary
 void complete(Individual... individuals)
          Decodes and evaluates all given Individuals if they are not already evaluated.
 void complete(java.lang.Iterable<? extends Individual> iterable)
          Decodes and evaluates all Individuals in the Iterable if they are not already evaluated.
protected  void decode(Individual individual)
           
protected  void evaluate(Individual individual)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decoder

protected final Decoder<Genotype,java.lang.Object> decoder

evaluator

protected final Evaluator<java.lang.Object> evaluator

control

protected final Control control
Constructor Detail

SequentialIndividualCompleter

@Inject
public SequentialIndividualCompleter(Control control,
                                            Decoder<Genotype,java.lang.Object> decoder,
                                            Evaluator<java.lang.Object> evaluator)
Constructs a SequentialIndividualCompleter.

Parameters:
control - the optimization control
decoder - the decoder
evaluator - the evaluator
Method Detail

complete

public void complete(java.lang.Iterable<? extends Individual> iterable)
              throws TerminationException
Description copied from interface: IndividualCompleter
Decodes and evaluates all Individuals in the Iterable if they are not already evaluated.

Specified by:
complete in interface IndividualCompleter
Parameters:
iterable - the set of individuals to be completed
Throws:
TerminationException - if the optimization is terminated

complete

public void complete(Individual... individuals)
              throws TerminationException
Description copied from interface: IndividualCompleter
Decodes and evaluates all given Individuals if they are not already evaluated.

Specified by:
complete in interface IndividualCompleter
Parameters:
individuals - the individuals to be completed
Throws:
TerminationException - if the optimization is terminated

evaluate

protected void evaluate(Individual individual)

decode

protected void decode(Individual individual)