/home/ooechs/ECJ_Tutorial/src/ac/essex/ecj/util/StatisticsPrinter.java
|
package ac.essex.ecj.util;
import ec.gp.koza.KozaStatistics;
import ec.EvolutionState;
import ec.util.Output;
import ec.simple.SimpleProblemForm;
/**
* <p/>
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version,
* provided that any use properly credits the author.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details at http://www.gnu.org
* </p>
*
* @author Olly Oechsle, University of Essex, Date: 17-Aug-2006
* @version 1.0
*/
public class StatisticsPrinter extends KozaStatistics {
public void finalStatistics(final EvolutionState state, final int result) {
// print out the other statistics
super.finalStatistics(state, result);
// we have only one population, so this is kosher
((SimpleProblemForm) (state.evaluator.p_problem.protoCloneSimple())).describe(best_of_run[0], state, 0, statisticslog, Output.V_NO_GENERAL);
System.out.println("Done :)");
}
public void postEvaluationStatistics(EvolutionState state) {
super.postEvaluationStatistics(state);
System.out.println();
// we have only one population, so this is kosher
((SimpleProblemForm) (state.evaluator.p_problem.protoCloneSimple())).describe(best_of_run[0], state, 0, statisticslog, Output.V_NO_GENERAL);
}
}