Package org.opt4j.core.common.completer
Class SequentialIndividualCompleter
- java.lang.Object
-
- 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 theIndividual
s sequentially.It updates the
Individual.State
of theIndividual
according to the state of the completion process. It usesControl
between the different (possibly time consuming) completion steps to allow the user to control the completion process.
-
-
Constructor Summary
Constructors Constructor Description SequentialIndividualCompleter(Control control, Decoder<Genotype,java.lang.Object> decoder, Evaluator<java.lang.Object> evaluator)
Constructs aSequentialIndividualCompleter
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete(java.lang.Iterable<? extends Individual> iterable)
Decodes and evaluates allIndividual
s in theIterable
if they are not already evaluated.void
complete(Individual... individuals)
Decodes and evaluates all givenIndividual
s if they are not already evaluated.protected void
decode(Individual individual)
Decodes theGenotype
of theIndividual
.protected void
evaluate(Individual individual)
Evaluates the phenotype of theIndividual
.
-
-
-
Constructor Detail
-
SequentialIndividualCompleter
@Inject public SequentialIndividualCompleter(Control control, Decoder<Genotype,java.lang.Object> decoder, Evaluator<java.lang.Object> evaluator)
Constructs aSequentialIndividualCompleter
.- Parameters:
control
- the optimization controldecoder
- the decoderevaluator
- the evaluator
-
-
Method Detail
-
complete
public void complete(java.lang.Iterable<? extends Individual> iterable) throws TerminationException
Description copied from interface:IndividualCompleter
Decodes and evaluates allIndividual
s in theIterable
if they are not already evaluated.- Specified by:
complete
in interfaceIndividualCompleter
- 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 givenIndividual
s if they are not already evaluated.- Specified by:
complete
in interfaceIndividualCompleter
- Parameters:
individuals
- the individuals to be completed- Throws:
TerminationException
- if the optimization is terminated
-
evaluate
protected void evaluate(Individual individual)
Evaluates the phenotype of theIndividual
. After this operation, theIndividual
is inIndividual.State
Individual.State.EVALUATED
andIndividual.getObjectives()
returns theObjectives
.- Parameters:
individual
-
-
decode
protected void decode(Individual individual)
Decodes theGenotype
of theIndividual
. After this operation, theIndividual
is inIndividual.State
Individual.State.PHENOTYPED
andIndividual.getPhenotype()
returns the phenotype.- Parameters:
individual
-
-
-