Get current iteration

Dear all,

Cause the calculation can takes a long time, i would like to get the current iteration during the solver’s process in the aim to send it to the client.
Maybe by using an event or a thread but i didn’t find a way to do this. I found only with the console.

Thankyou for your helping

Using the current iteration (for anything, and especially for sending it to the customer) is not a good idea, because it could be much worse than the current best solution.
Getting the current best solution is another question. I have no source here now, but I’ll see how to get it in the right way, later. Meanwhile, there is an easy way to get notification as soon as the best solution is updated is by overriding the SolutionSelector to post any new accepted and better solutions to your application. It is somehow a hack, but easy to implement.

You can always implement IterationEndsListener and add it to the algorithm with algorithm.addListener(…). This gives you access to the current iteration as well as to the global best solution found so far.