Class NestedBoolean

  • All Implemented Interfaces:
    Serializable, Cloneable, Comparable, org.jgap.gp.IMutateable, org.jgap.util.ICloneable

    public class NestedBoolean
    extends org.jgap.gp.CommandGene
    implements org.jgap.gp.IMutateable, org.jgap.util.ICloneable
    Command for Link Spec trees with multiple Boolean Commands: Childs are either Measures(StringMeasure or NumberMeasure) or NestedBooleans.
    Version:
    Jul 21, 2016
    Author:
    Klaus Lyko, Mohamed Sherif (sherif@informatik.uni-leipzig.de)
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.jgap.gp.CommandGene

        org.jgap.gp.CommandGene.COMMAND_TYPE
    • Field Summary

      • Fields inherited from class org.jgap.gp.CommandGene

        BooleanClass, CharacterClass, DELTA, DoubleClass, FloatClass, IntegerClass, LongClass, nodeIndex, VoidClass
      • Fields inherited from interface org.jgap.util.ICloneable

        CVS_REVISION
      • Fields inherited from interface org.jgap.gp.IMutateable

        CVS_REVISION
    • Constructor Summary

      Constructors 
      Constructor Description
      NestedBoolean​(String op, org.jgap.gp.impl.GPConfiguration a_conf)
      Basic Constructor.
      NestedBoolean​(String op, org.jgap.gp.impl.GPConfiguration a_conf, Class<?> a_returnType, boolean mutable)
      Constructor to define return type, and if NestedBoolean supports mutation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.jgap.gp.CommandGene applyMutation​(int a_index, double a_percentage)  
      Object clone()
      Clones the object.
      Object execute_object​(org.jgap.gp.impl.ProgramChromosome a_chrom, int a_n, Object[] args)
      Executes this CommandGene as object.
      void execute_void​(org.jgap.gp.impl.ProgramChromosome a_chrom, int a_n, Object[] args)  
      Class<?> getChildType​(org.jgap.gp.IGPProgram a_ind, int a_chromNum)
      We expect the first 2 parameters to be resource identifier, the third to be an (optional) double value as the threshold for this Similarity command.
      String toString()  
      • Methods inherited from class org.jgap.gp.CommandGene

        check, check, cleanup, compareTo, dynamizeArity, ensureUniqueness, ensureUniqueness, ensureUniqueness2, equals, execute, execute_boolean, execute_double, execute_float, execute_int, execute_long, getAllele, getApplicationData, getArity, getArityMax, getArityMin, getCommandType, getEnergy, getGPConfiguration, getInternalValue, getName, getPersistentRepresentation, getPersistentRepresentationExt, getReturnType, getSubChildType, getSubChildTypes, getSubReturnType, hashCode, init, isAffectGlobalState, isCompareApplicationData, isFloatType, isIntegerType, isValid, isValid, setAllele, setApplicationData, setArity, setArityMax, setArityMin, setCompareApplicationData, setEnergy, setNoValidation, setReturnType, setToRandomValue, setValueFromPersistentRepresentation, setValueFromString, size
    • Constructor Detail

      • NestedBoolean

        public NestedBoolean​(String op,
                             org.jgap.gp.impl.GPConfiguration a_conf)
                      throws org.jgap.InvalidConfigurationException
        Basic Constructor.
        Parameters:
        op - Name of the boolean operator.
        a_conf - a_conf A JGAP GPconfiguration instance.
        Throws:
        org.jgap.InvalidConfigurationException - when an invalid value has been passed to a Configuration object
      • NestedBoolean

        public NestedBoolean​(String op,
                             org.jgap.gp.impl.GPConfiguration a_conf,
                             Class<?> a_returnType,
                             boolean mutable)
                      throws org.jgap.InvalidConfigurationException
        Constructor to define return type, and if NestedBoolean supports mutation.
        Parameters:
        op - Name of the boolean operator.
        a_conf - A JGAP GPconfiguration instance.
        a_returnType - Define the return type of this node.
        mutable - true means command(AND, OR, XOR) can mutate.
        Throws:
        org.jgap.InvalidConfigurationException - when an invalid value has been passed to a Configuration object
    • Method Detail

      • toString

        public String toString()
        Specified by:
        toString in class org.jgap.gp.CommandGene
      • getChildType

        public Class<?> getChildType​(org.jgap.gp.IGPProgram a_ind,
                                     int a_chromNum)
        We expect the first 2 parameters to be resource identifier, the third to be an (optional) double value as the threshold for this Similarity command.
        Overrides:
        getChildType in class org.jgap.gp.CommandGene
        Parameters:
        a_ind - A GPProgram
        a_chromNum - The number of the chromosome.
        Returns:
        Class type of the child.
      • execute_object

        public Object execute_object​(org.jgap.gp.impl.ProgramChromosome a_chrom,
                                     int a_n,
                                     Object[] args)
        Executes this CommandGene as object. Is called if the return type is set to String.class. Thereby returning the atomic LIMES expression "sim(a.resource, b.resource)|threshold".
        Overrides:
        execute_object in class org.jgap.gp.CommandGene
      • execute_void

        public void execute_void​(org.jgap.gp.impl.ProgramChromosome a_chrom,
                                 int a_n,
                                 Object[] args)
        Overrides:
        execute_void in class org.jgap.gp.CommandGene
      • clone

        public Object clone()
        Clones the object.
        Specified by:
        clone in interface org.jgap.util.ICloneable
        Overrides:
        clone in class Object
        Returns:
        cloned instance of this object
      • applyMutation

        public org.jgap.gp.CommandGene applyMutation​(int a_index,
                                                     double a_percentage)
                                              throws org.jgap.InvalidConfigurationException
        Specified by:
        applyMutation in interface org.jgap.gp.IMutateable
        Throws:
        org.jgap.InvalidConfigurationException