Class StringPreprocessingCommand

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

    public class StringPreprocessingCommand
    extends org.jgap.gp.CommandGene
    implements org.jgap.gp.IMutateable, org.jgap.util.ICloneable
    CommandGene to evolve preprocessing of properties. This is planned to be child of a String property.
    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 
      Modifier and Type Field Description
      static List<String> functions  
      • 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
      StringPreprocessingCommand​(org.jgap.gp.impl.GPConfiguration a_config, Class<?> a_returnType, String function, int subReturnType, boolean is_mutable)
      Full Constructor gives controal over return type.
      StringPreprocessingCommand​(org.jgap.gp.impl.GPConfiguration a_config, String function, int subReturnType)
      Default Constructor.
      StringPreprocessingCommand​(org.jgap.gp.impl.GPConfiguration a_config, String function, int subReturnType, boolean is_mutable)
      Constructor to also set if this command is mutable.
    • 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()  
      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, execute_object, execute_void, getAllele, getApplicationData, getArity, getArityMax, getArityMin, getChildType, 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
    • Field Detail

    • Constructor Detail

      • StringPreprocessingCommand

        public StringPreprocessingCommand​(org.jgap.gp.impl.GPConfiguration a_config,
                                          String function,
                                          int subReturnType)
                                   throws org.jgap.InvalidConfigurationException
        Default Constructor. Is not mutable, return type is String.
        Parameters:
        a_config - GPConfiguration, in most cases a LinkSpecGeneticLearnerConfig.
        function - The preprocessing function, e.g. "lowercase"
        subReturnType - A sub return type to distinguish from other commands.
        Throws:
        org.jgap.InvalidConfigurationException - when an invalid value has been passed to a Configuration object
      • StringPreprocessingCommand

        public StringPreprocessingCommand​(org.jgap.gp.impl.GPConfiguration a_config,
                                          String function,
                                          int subReturnType,
                                          boolean is_mutable)
                                   throws org.jgap.InvalidConfigurationException
        Constructor to also set if this command is mutable.
        Parameters:
        a_config - GPConfiguration, in most cases a LinkSpecGeneticLearnerConfig.
        function - The preprocessing function, e.g. "lowercase"
        subReturnType - A sub return type to distinguish from other commands.
        is_mutable -
        Throws:
        org.jgap.InvalidConfigurationException - when an invalid value has been passed to a Configuration object
      • StringPreprocessingCommand

        public StringPreprocessingCommand​(org.jgap.gp.impl.GPConfiguration a_config,
                                          Class<?> a_returnType,
                                          String function,
                                          int subReturnType,
                                          boolean is_mutable)
                                   throws org.jgap.InvalidConfigurationException
        Full Constructor gives controal over return type.
        Parameters:
        a_config - GPConfiguration, in most cases a LinkSpecGeneticLearnerConfig.
        a_returnType - Defines the return type.
        function - The preprocessing function, e.g. "lowercase"
        subReturnType - A sub return type to distinguish from other commands.
        is_mutable - boolean
        Throws:
        org.jgap.InvalidConfigurationException - when an invalid value has been passed to a Configuration object
    • Method Detail

      • clone

        public Object clone()
        Specified by:
        clone in interface org.jgap.util.ICloneable
        Overrides:
        clone in class 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
      • toString

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