Package org.opt4j.core.optimizer
Class AbstractOptimizer
java.lang.Object
org.opt4j.core.optimizer.AbstractOptimizer
- All Implemented Interfaces:
Optimizer
- Direct Known Subclasses:
OptimizationMediator
The
AbstractOptimizer is an abstract implementation of a
population-based Optimizer. It provides the necessary coupling to the
framework by informing all OptimizerStateListeners and
OptimizerIterationListeners, calling the IndividualCompleter
to decode and evaluate new Individuals and adding them
to the Archive. The Control is checked regularly to allow
user interaction.
To implement an iteration-based Optimizer, the
IterativeOptimizer interface is available.-
Constructor Summary
ConstructorsConstructorDescriptionAbstractOptimizer(Population population, Archive archive, IndividualCompleter completer, Control control, Iteration iteration) Constructs anAbstractOptimizerwith aPopulation, anArchive, anIndividualFactory, and aIndividualCompleter. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds anOptimizerIterationListenerto this optimizer.voidAdds anOptimizerStateListenerto this optimizer.intReturn the current iteration.booleanReturnstrueif theOptimizeris running.voidRemoves anOptimizerIterationListenerfrom this optimizer.voidRemoves anOptimizerStateListenerfrom this optimizer.voidThis method is called to start the optimization process.voidThis method is called once the optimization process has stopped.
-
Constructor Details
-
AbstractOptimizer
public AbstractOptimizer(Population population, Archive archive, IndividualCompleter completer, Control control, Iteration iteration) Constructs anAbstractOptimizerwith aPopulation, anArchive, anIndividualFactory, and aIndividualCompleter.- Parameters:
population- the specified populationarchive- the specified archivecompleter- the specified completercontrol- the controliteration- the iteration counter
-
-
Method Details
-
getIteration
Description copied from interface:OptimizerReturn the current iteration.- Specified by:
getIterationin interfaceOptimizer- Returns:
- the current iteration
-
isRunning
Description copied from interface:OptimizerReturnstrueif theOptimizeris running. -
startOptimization
Description copied from interface:OptimizerThis method is called to start the optimization process.- Specified by:
startOptimizationin interfaceOptimizer
-
stopOptimization
Description copied from interface:OptimizerThis method is called once the optimization process has stopped.- Specified by:
stopOptimizationin interfaceOptimizer
-
addOptimizerIterationListener
Description copied from interface:OptimizerAdds anOptimizerIterationListenerto this optimizer.- Specified by:
addOptimizerIterationListenerin interfaceOptimizer- Parameters:
listener- the OptimizerIterationListener to add- See Also:
-
addOptimizerStateListener
Description copied from interface:OptimizerAdds anOptimizerStateListenerto this optimizer.- Specified by:
addOptimizerStateListenerin interfaceOptimizer- Parameters:
listener- the OptimizerStateListener to add- See Also:
-
removeOptimizerIterationListener
Description copied from interface:OptimizerRemoves anOptimizerIterationListenerfrom this optimizer.- Specified by:
removeOptimizerIterationListenerin interfaceOptimizer- Parameters:
listener- the OptimizerIterationListener to remove- See Also:
-
removeOptimizerStateListener
Description copied from interface:OptimizerRemoves anOptimizerStateListenerfrom this optimizer.- Specified by:
removeOptimizerStateListenerin interfaceOptimizer- Parameters:
listener- the OptimizerStateListener to remove- See Also:
-