Package org.opt4j.common.completer
Class ParallelIndividualCompleter
java.lang.Object
org.opt4j.common.completer.SequentialIndividualCompleter
org.opt4j.common.completer.ParallelIndividualCompleter
- All Implemented Interfaces:
IndividualCompleter,OptimizerStateListener
public class ParallelIndividualCompleter
extends SequentialIndividualCompleter
implements OptimizerStateListener
The
ParallelIndividualCompleter completes Individuals with
multiple threads.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classTheParallelIndividualCompleter.Completeclass completes a singleIndividual. -
Field Summary
FieldsFields inherited from class org.opt4j.common.completer.SequentialIndividualCompleter
control, decoder, evaluator -
Constructor Summary
ConstructorsConstructorDescriptionParallelIndividualCompleter(Control control, Decoder decoder, Evaluator evaluator, int maxThreads) Constructs aParallelIndividualCompleterwith a specified maximal number of concurrent threads. -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete(Iterable<? extends Individual> iterable) Decodes and evaluates allIndividuals in theIterableif they are not already evaluated.protected voidfinalize()voidoptimizationStarted(Optimizer optimizer) Invoked if theOptimizerstarts the optimization process.voidoptimizationStopped(Optimizer optimizer) Invoked if theOptimizerstops the optimization process.protected voidShutdown theExecutorService.Methods inherited from class org.opt4j.common.completer.SequentialIndividualCompleter
complete, decode, evaluate
-
Field Details
-
executor
-
-
Constructor Details
-
ParallelIndividualCompleter
@Inject public ParallelIndividualCompleter(Control control, Decoder decoder, Evaluator evaluator, int maxThreads) Constructs aParallelIndividualCompleterwith a specified maximal number of concurrent threads.- Parameters:
control- the controldecoder- the decoderevaluator- the evaluatormaxThreads- the maximal number of parallel threads (using namespaceParallelIndividualCompleter)
-
-
Method Details
-
complete
Description copied from interface:IndividualCompleterDecodes and evaluates allIndividuals in theIterableif they are not already evaluated.- Specified by:
completein interfaceIndividualCompleter- Overrides:
completein classSequentialIndividualCompleter- Parameters:
iterable- the set of individuals to be completed- Throws:
TerminationException- if the optimization is terminated
-
finalize
-
shutdownExecutorService
protected void shutdownExecutorService()Shutdown theExecutorService. -
optimizationStarted
Description copied from interface:OptimizerStateListenerInvoked if theOptimizerstarts the optimization process.- Specified by:
optimizationStartedin interfaceOptimizerStateListener- Parameters:
optimizer- the optimizer
-
optimizationStopped
Description copied from interface:OptimizerStateListenerInvoked if theOptimizerstops the optimization process.- Specified by:
optimizationStoppedin interfaceOptimizerStateListener- Parameters:
optimizer- the optimizer
-