Documentation of 'org.jgap.impl.fitness.TruthTableFitnessFunction' Java class
TruthTableFitnessFunction
org.jgap.impl.fitness

Class TruthTableFitnessFunction

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, ICloneable


    public abstract class TruthTableFitnessFunction
    extends FitnessFunction
    Fitness Function relying on a truth table. To use this class, just implement a subclass of it, register the current truth table and implement the evaluate method in a way that you can call calcFitness with the required (parameter (given values: encoded with the chromosome). If the truth table is dynamic just register it in evaluate, otherwise do it after construction of this fitness function.
    Since:
    2.4
    See Also:
    Serialized Form
    • Constructor Detail

      • TruthTableFitnessFunction

        public TruthTableFitnessFunction()
        Only use for dynamic instantiation as configuration retrieved from static setting.
        Since:
        2.4
      • TruthTableFitnessFunction

        public TruthTableFitnessFunction(Configuration a_conf)
        Constructor without registering a truth table. Use this constructor if the truth table is not fix over generations and needs to be set in method evaluate.
        Parameters:
        a_conf - the configuration to use
        Since:
        3.01
      • TruthTableFitnessFunction

        public TruthTableFitnessFunction(Configuration a_conf,
                                         java.util.Map a_truthTable)
        Constructor for registering a truth table. Use this constructor if the truth table is fix over generations.
        Parameters:
        a_conf - the configuration to use
        a_truthTable - table of input/output pairs for feeding the formula and determining the fitness value thru delta computation
        Since:
        3.1
    • Method Detail

      • setTruthTable

        public void setTruthTable(java.util.Map a_truthTable)
      • getTruthTable

        public java.util.Map getTruthTable()
      • calcFitness

        public double calcFitness(java.util.Map a_actualInputOutput)
        Fitness value calculation for a given table of input/output tupels and a truth-table (also given as list of input/output tupels)
        Parameters:
        a_actualInputOutput - table of actual input/output pairs
        Returns:
        delta between current values and given truth table
        Since:
        2.4
      • getConfiguration

        public Configuration getConfiguration()
        Returns:
        the Configuration object set
        Since:
        3.1

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.