public class ParallelIndividualCompleter extends SequentialIndividualCompleter implements OptimizerStateListener
ParallelIndividualCompleter completes Individuals with
multiple threads.| Modifier and Type | Class and Description |
|---|---|
protected class |
ParallelIndividualCompleter.Complete
The
ParallelIndividualCompleter.Complete class completes a single Individual. |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ExecutorService |
executor |
control, decoder, evaluator| Constructor and Description |
|---|
ParallelIndividualCompleter(Control control,
Decoder<Genotype,java.lang.Object> decoder,
Evaluator<java.lang.Object> evaluator,
int maxThreads)
Constructs a
ParallelIndividualCompleter with a specified maximal
number of concurrent threads. |
| Modifier and Type | Method and Description |
|---|---|
void |
complete(java.lang.Iterable<? extends Individual> iterable)
Decodes and evaluates all
Individuals in the Iterable if
they are not already evaluated. |
protected void |
finalize() |
void |
optimizationStarted(Optimizer optimizer)
Invoked if the
Optimizer starts the optimization process. |
void |
optimizationStopped(Optimizer optimizer)
Invoked if the
Optimizer stops the optimization process. |
protected void |
shutdownExecutorService()
Shutdown the
ExecutorService. |
complete, decode, evaluate@Inject public ParallelIndividualCompleter(Control control, Decoder<Genotype,java.lang.Object> decoder, Evaluator<java.lang.Object> evaluator, int maxThreads)
ParallelIndividualCompleter with a specified maximal
number of concurrent threads.control - the controldecoder - the decoderevaluator - the evaluatormaxThreads - the maximal number of parallel threads (using namespace
ParallelIndividualCompleter)public void complete(java.lang.Iterable<? extends Individual> iterable) throws TerminationException
IndividualCompleterIndividuals in the Iterable if
they are not already evaluated.complete in interface IndividualCompletercomplete in class SequentialIndividualCompleteriterable - the set of individuals to be completedTerminationException - if the optimization is terminatedprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwableprotected void shutdownExecutorService()
ExecutorService.public void optimizationStarted(Optimizer optimizer)
OptimizerStateListenerOptimizer starts the optimization process.optimizationStarted in interface OptimizerStateListeneroptimizer - the optimizerpublic void optimizationStopped(Optimizer optimizer)
OptimizerStateListenerOptimizer stops the optimization process.optimizationStopped in interface OptimizerStateListeneroptimizer - the optimizer