Hello,
I just started using Opt4J for my project and I really liked the graphical interface.
I need, however, to automatically detect when the optimization has converged to a local/global optima.
A rudimentary criterion I often use to estimate convergence is if the best solution remains the same for a given number of iterations.
Is there any way to do this, or something better, using Opt4J?
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Kirus,
you can implement an OptimizationIterationListener (http://opt4j.sourceforge.net/javadoc/3.1/org/opt4j/core/optimizer/OptimizerIterationListener.html). Add it in a module with the addOptimizerIterationListener(Class<? extends OptimizerIterationListener> listener) method.
In this class that implements OptimizationIterationListener you can inject the Archive in the constructor and check each iteration (the method is implemented via OptimizationIterationListener) if there was an improvement. You can of course also implement the IndividualSetListener and listen to changes in the Archive.
Best Regards,
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I just started using Opt4J for my project and I really liked the graphical interface.
I need, however, to automatically detect when the optimization has converged to a local/global optima.
A rudimentary criterion I often use to estimate convergence is if the best solution remains the same for a given number of iterations.
Is there any way to do this, or something better, using Opt4J?
Cheers
Hi Kirus,
you can implement an OptimizationIterationListener (http://opt4j.sourceforge.net/javadoc/3.1/org/opt4j/core/optimizer/OptimizerIterationListener.html). Add it in a module with the addOptimizerIterationListener(Class<? extends OptimizerIterationListener> listener) method.
In this class that implements OptimizationIterationListener you can inject the Archive in the constructor and check each iteration (the method is implemented via OptimizationIterationListener) if there was an improvement. You can of course also implement the IndividualSetListener and listen to changes in the Archive.
Best Regards,
Martin