Anonymous - 2015-09-21

The instrumenter is useful for collecting performance metrics. There are a bunch built in, such as generational distance, hypervolume, etc. You can also define your own custom collector, such as:

import org.moeaframework.core.Algorithm;
import org.moeaframework.core.EpsilonBoxDominanceArchive;
import org.moeaframework.core.Indicator;
import org.moeaframework.core.NondominatedPopulation;

public class CustomCollector implements Collector {

    private final Algorithm algorithm;

    public CustomCollector(Algorithm algorithm) {
        super();
        this.algorithm = algorithm;
    }

    @Override
    public void collect(Accumulator accumulator) {
        NondominatedPopulation result = algorithm.getResult();

        // compute your convergence metric

        accumulator.add("My Convergence Metric", value);
    }

    @Override
    public AttachPoint getAttachPoint() {
        return AttachPoint.isSubclass(Algorithm.class).and(
                AttachPoint.not(AttachPoint.isNestedIn(Algorithm.class)));
    }

    @Override
    public Collector attach(Object object) {
        return new CustomCollector((Algorithm)object);
    }

}

Then attach it with your instrumenter: new Instrumenter().attach(new CustomCollector(null)).

Since you are using NSGA-III, I would encourage you to use the latest code at https://github.com/MOEAFramework/MOEAFramework. We have made a number of enhancements, including better default values for NSGA-III's parameters.