class SimpleFunctionEvaluator implements FunctionEvaluator {

    public void evaluate(Population[] populations, Function function) {
        // check the arguments
        if (populations != null && function != null){
            for (Population population : populations){
                if (population.getIndividuals() != null){
                    for (Individual individual : population.getIndividuals()){
                        if (individual.getRepresentation() != null){
                            individual.setValue(function.valueAt(individual.getCurrentPosition()));
                        }
                    }
                }
            }
        }
    }

}