Documentation of 'org.jgap.gp.function.ADF' Java class
ADF
org.jgap.gp.function

Class ADF

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable


    public class ADF
    extends CommandGene
    Automatically Defined Function (ADF). Works with output of other chromosomes. An ADF is automatically created by ProgramChromosome. For more information about ADFs see John Koza's book on Genetic Programming. Or google for "Koza ADF". For a German explanation, see see http://www.tu-chemnitz.de/informatik/ThIS/seminare/ws01/gp/singer.pdf or http://www.tu-chemnitz.de/informatik/ThIS/seminare/ws01/gp/forbriger.pdf or http://www.klaus-meffert.de/download/genetische_programmierung_mit_java.pdf
    Since:
    3.0
    See Also:
    Serialized Form
    • Method Detail

      • getChromosomeNum

        public int getChromosomeNum()
        Returns:
        the index of the chromosome to execute
        Since:
        3.0
      • toString

        public java.lang.String toString()
        Specified by:
        toString in class CommandGene
        Returns:
        the string representation of the command. Especially usefull to output a resulting formula in human-readable form.
      • getArity

        public int getArity(IGPProgram a_individual)
        Description copied from class: CommandGene
        Arity of the command. Override if necessary. The arity is the number of children a node has.
        Overrides:
        getArity in class CommandGene
        Parameters:
        a_individual - the invididual the command's arity may depend on (in most cases the arity will not depend on the individual)
        Returns:
        arity of the command
      • execute_int

        public int execute_int(ProgramChromosome c,
                               int n,
                               java.lang.Object[] args)
        Description copied from class: CommandGene
        Executes this node as an integer. Override to implement.
        Overrides:
        execute_int in class CommandGene
        Parameters:
        c - ignored here
        n - ignored here
        args - ignored here
        Returns:
        nothing but exception
      • execute_boolean

        public boolean execute_boolean(ProgramChromosome c,
                                       int n,
                                       java.lang.Object[] args)
        Description copied from class: CommandGene
        Executes this node as a boolean. Override to implement.
        Overrides:
        execute_boolean in class CommandGene
        Parameters:
        c - ignored here
        n - ignored here
        args - ignored here
        Returns:
        nothing but exception
      • execute_float

        public float execute_float(ProgramChromosome c,
                                   int n,
                                   java.lang.Object[] args)
        Description copied from class: CommandGene
        Executes this node as a float. Override to implement.
        Overrides:
        execute_float in class CommandGene
        Parameters:
        c - ignored here
        n - ignored here
        args - ignored here
        Returns:
        nothing but exception
      • execute_double

        public double execute_double(ProgramChromosome c,
                                     int n,
                                     java.lang.Object[] args)
        Description copied from class: CommandGene
        Executes this node as a double. Override to implement.
        Overrides:
        execute_double in class CommandGene
        Parameters:
        c - ignored here
        n - ignored here
        args - ignored here
        Returns:
        nothing but exception
      • execute_object

        public java.lang.Object execute_object(ProgramChromosome c,
                                               int n,
                                               java.lang.Object[] args)
        Description copied from class: CommandGene
        Executes this node as an object. Override to implement.
        Overrides:
        execute_object in class CommandGene
        Parameters:
        c - ignored here
        n - ignored here
        args - ignored here
        Returns:
        nothing but exception
      • getChildType

        public java.lang.Class getChildType(IGPProgram a_ind,
                                            int i)
        Description copied from class: CommandGene
        Gets the type of node allowed from the given child number. Should be overridden in subclasses.
        Overrides:
        getChildType in class CommandGene
        Parameters:
        a_ind - the individual the child belongs to
        i - the chromosome number
        Returns:
        the type of node allowed for that child, or null of no child exists
      • isValid

        public boolean isValid(ProgramChromosome a_chrom)
        Description copied from class: CommandGene
        Subclasses capable of validating programs should overwrite this method. See class Push as a sample.
        Overrides:
        isValid in class CommandGene
        Parameters:
        a_chrom - the ProgramChromosome to validate
        Returns:
        true: a_program is (superficially) valid with the current Command
      • compareTo

        public int compareTo(java.lang.Object a_other)
        The compareTo-method.
        Specified by:
        compareTo in interface java.lang.Comparable
        Overrides:
        compareTo in class CommandGene
        Parameters:
        a_other - the other object to compare
        Returns:
        -1, 0, 1
        Since:
        3.0
      • equals

        public boolean equals(java.lang.Object a_other)
        The equals-method.
        Overrides:
        equals in class CommandGene
        Parameters:
        a_other - the other object to compare
        Returns:
        true if the objects are seen as equal
        Since:
        3.0

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.