Package org.opt4j.core.optimizer
Interface Optimizer
- All Known Implementing Classes:
AbstractOptimizer,DifferentialEvolution,EvolutionaryAlgorithm,MOPSO,RandomSearch,SimulatedAnnealing
public interface Optimizer
This
Optimizer interface has to be implemented by all
population-based optimizers.-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds anOptimizerIterationListenerto this optimizer.voidAdds anOptimizerStateListenerto this optimizer.intReturn the current iteration.booleanReturnstrueif theOptimizeris running.voidoptimize()Starts the optimization process.voidRemoves anOptimizerIterationListenerfrom this optimizer.voidRemoves anOptimizerStateListenerfrom this optimizer.voidThis method is called once the optimization process has started.voidThis method is called once the optimization process has stopped.
-
Method Details
-
optimize
Starts the optimization process.- Throws:
StopException- if the optimization is stoppedTerminationException- if the optimization is terminated
-
addOptimizerIterationListener
Adds anOptimizerIterationListenerto this optimizer.- Parameters:
listener- the OptimizerIterationListener to add- See Also:
-
removeOptimizerIterationListener
Removes anOptimizerIterationListenerfrom this optimizer.- Parameters:
listener- the OptimizerIterationListener to remove- See Also:
-
addOptimizerStateListener
Adds anOptimizerStateListenerto this optimizer.- Parameters:
listener- the OptimizerStateListener to add- See Also:
-
removeOptimizerStateListener
Removes anOptimizerStateListenerfrom this optimizer.- Parameters:
listener- the OptimizerStateListener to remove- See Also:
-
getIteration
int getIteration()Return the current iteration.- Returns:
- the current iteration
-
isRunning
boolean isRunning()Returnstrueif theOptimizeris running.- Returns:
trueif the optimizer is running
-
startOptimization
void startOptimization()This method is called once the optimization process has started. -
stopOptimization
void stopOptimization()This method is called once the optimization process has stopped.
-