Menu

Detecting convergence?

Kirus
2014-05-16
2014-05-25
  • Kirus

    Kirus - 2014-05-16

    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

     
  • Martin Lukasiewycz

    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

     

Log in to post a comment.