/*
 * Evaluator.java
 *
 * Created on 20. listopad 2005, 13:23
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package cz.pcland.ga.fitness;
import cz.pcland.ga.BaseIndividual;
import java.util.*;
/**
 *
 * @author petr
 */
public interface Evaluator {
    
    /**
     * Called before GA starts to set data for evalutaion
     */
    abstract public void setDataObject(Object data);
    
    /**
     * Returns public name of fitness object
     */
    abstract public String toString();
    
    
    /**
     * returns true if end value has been reached. Algorithm does not react, only checks.
     */
    abstract public boolean isEnd(BaseIndividual bi);
    
    /**
     * For final fitness correction, eg: To set fitness to value greater than zero
     */
    abstract public void postEvaluate(BaseIndividual[] population, double min, double max);
    
    /**
     * Called before every evalutaion
     */
    abstract public void init(BaseIndividual[] population);
    
    /**
     * Called at the begining of run before first evaluation and after population is fully created
     */
    abstract public void onStart(BaseIndividual[] population);
       
    /**
     * gets evalutaion.
     */
    abstract public double getEvaluation(BaseIndividual str);
    
       
}
