Open sherzig opened 7 years ago
Hi Sebastian,
Actually, my assumption would have been that it works with the progress listener. In fact, there is a class that already those that partially [1]. The problem seems to be that the Instrumenter.getLastAccumulator() [2] method from MOEA returns null. In the MOEA framework, an accumulator stores collected data from a single run of an algorithm. The instrumenter used in MOMoT collects these accumulators to gather the necessary data during the execution. Unfortunately, I do not have the time to debug into this right now. Maybe an update on a newer version of MOEA fixes this issue, but I did not check. Hopefully, I could point you in the right direction and sorry for not being able to provide a more positive answer.
[1] https://github.com/martin-fleck/momot/blob/master/plugins/at.ac.tuwien.big.moea/src/at/ac/tuwien/big/moea/experiment/executor/listener/CollectiveProgressListener.java [2] http://moeaframework.org/javadoc/org/moeaframework/Instrumenter.html
No problem! Thanks for the pointers - I will have a closer look and submit a pull request if I find the solution.
OK, I think I found the solution. First off, I've migrated MOMoT (mostly) to MOEA 2.12. As for the approximation set:
SearchExperiment.java
defines a method setAllCollectors(boolean)
. However, this function is never called (anywhere, from what I can tell).experiment = {
...
collectors = [ approximationSet new SimpleBestSolutionCollector() ]
// Must appear as last entry, otherwise compilation error is thrown
}
As mentioned in the comment, this must also appear as the last line in the experiment section.
With the above, I can access the approximation set from the accumulator. It seems that by default only the NFE is collected.
BTW, I found a couple of other smaller bugs along the way - e.g., AccumulatorUtil.getLatestAlgorithm
returns an object of type Solution
, which should probably be an Algorithm
instead.
I'll send you a pull request once I've completed testing.
Is there a way to return the current population using a progress listener? I've tried to do this by retrieving the approximation set through the executor and instrumenter accessible from the event. However, it's returned null / an empty list. Any clues?
Thanks