Documentation of 'org.jgap.gp.IGPChromosome' Java class
IGPChromosome
org.jgap.gp

Interface IGPChromosome

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    BaseGPChromosome, ProgramChromosome


    public interface IGPChromosome
    extends java.io.Serializable
    Interface for GP chromosomes. See ProgramChromosome for an implementation.
    Since:
    3.01
    • Field Detail

      • CVS_REVISION

        static final java.lang.String CVS_REVISION
        String containing the CVS revision. Read out via reflection!
        See Also:
        Constant Field Values
    • Method Detail

      • getIndividual

        IGPProgram getIndividual()
        Returns:
        the individual containing this chromosome
        Since:
        3.01
      • setIndividual

        void setIndividual(IGPProgram a_ind)
        Sets the individual the chromosome belongs to.
        Parameters:
        a_ind - the individual containing this chromosome
        Since:
        3.01
      • cleanup

        void cleanup()
        Clean up the chromosome.
        Since:
        3.01
      • toStringNorm

        java.lang.String toStringNorm(int a_startNode)
        Output program in "natural" notion (e.g.: "X + Y" for "X + Y")
        Parameters:
        a_startNode - the node to start with
        Returns:
        output in normalized notion
        Since:
        3.01
      • redepth

        void redepth()
        Recalculate the depths of each node.
        Since:
        3.01
      • numTerminals

        int numTerminals()
        Returns:
        the number of terminals in this chromosome
        Since:
        3.01
      • numFunctions

        int numFunctions()
        Returns:
        the number of functions in this chromosome
        Since:
        3.01
      • numTerminals

        int numTerminals(java.lang.Class a_type,
                         int a_subType)
        Counts the number of terminals of the given type in this chromosome.
        Parameters:
        a_type - the type of terminal to count
        a_subType - the subtype to consider
        Returns:
        the number of terminals in this chromosome
        Since:
        3.01
      • numFunctions

        int numFunctions(java.lang.Class a_type,
                         int a_subType)
        Counts the number of functions of the given type in this chromosome.
        Parameters:
        a_type - the type of function to count
        a_subType - the subtype to consider
        Returns:
        the number of functions in this chromosome.
        Since:
        3.01
      • getNode

        CommandGene getNode(int a_index)
        Gets the a_index'th node in this chromosome. The nodes are counted in a depth-first manner, with node 0 being the root of this chromosome.
        Parameters:
        a_index - the node number to get
        Returns:
        the node
        Since:
        3.01
      • getChild

        int getChild(int a_index,
                     int a_child)
        Gets the a_child'th child of the a_index'th node in this chromosome. This is the same as the a_child'th node whose depth is one more than the depth of the a_index'th node.
        Parameters:
        a_index - the node number of the parent
        a_child - the child number (starting from 0) of the parent
        Returns:
        the node number of the child, or -1 if not found
        Since:
        3.01
      • getTerminal

        int getTerminal(int a_index)
        Gets the i'th terminal in this chromosome. The nodes are counted in a depth-first manner, with node 0 being the first terminal in this chromosome.
        Parameters:
        a_index - the i'th terminal to get
        Returns:
        the terminal
        Since:
        3.01
      • getFunction

        int getFunction(int a_index)
        Gets the a_index'th function in this chromosome. The nodes are counted in a depth-first manner, with node 0 being the first function in this chromosome.
        Parameters:
        a_index - the a_index'th function to get
        Returns:
        the function
        Since:
        3.01
      • getTerminal

        int getTerminal(int a_index,
                        java.lang.Class a_type,
                        int a_subType)
        Gets the a_index'th terminal of the given type in this chromosome. The nodes are counted in a depth-first manner, with node 0 being the first terminal of the given type in this chromosome.
        Parameters:
        a_index - the a_index'th terminal to get
        a_type - the type of terminal to get
        a_subType - the subtype to consider
        Returns:
        the index of the terminal found, or -1 if no appropriate terminal was found
        Since:
        3.01
      • getFunction

        int getFunction(int a_index,
                        java.lang.Class a_type,
                        int a_subType)
        Gets the i'th function of the given type in this chromosome. The nodes are counted in a depth-first manner, with node 0 being the first function of the given type in this chromosome.
        Parameters:
        a_index - the i'th function to get
        a_type - the type of function to get
        a_subType - the subtype to consider
        Returns:
        the index of the function found, or -1 if no appropriate function was found
        Since:
        3.01
      • getFunctionSet

        CommandGene[] getFunctionSet()
        Returns:
        set of CommandGene instances allowed
        Since:
        3.2.1
      • getPersistentRepresentation

        java.lang.String getPersistentRepresentation()
        Returns:
        the persistent representation of the population, including all GP programs
        Since:
        3.3

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.