Anonymous - 2015-11-17

I would suggest looking at some of the example problems in src/org/moeaframework/problem/. Below is an example reading the real value from decision variables:

@Override
public void evaluate(Solution solution) {
    double x = EncodingUtils.getReal(solution.getVariable(0));
    double y = EncodingUtils.getReal(solution.getVariable(1));
    double f1 = Math.pow(x, 2.0) + Math.pow(y, 2.0);
    double f2 = Math.pow(x+2.0, 2.0) + Math.pow(y, 2.0);

    solution.setObjective(0, f1);
    solution.setObjective(1, f2);
}