org.jgap.gp.terminal
Class Constant
- java.lang.Object
-
- org.jgap.gp.CommandGene
-
- org.jgap.gp.MathCommand
-
- org.jgap.gp.terminal.Constant
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable
public class Constant extends MathCommand
A constant remaining the same value all time.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jgap.gp.CommandGene
CommandGene.COMMAND_TYPE
-
-
Field Summary
-
Fields inherited from class org.jgap.gp.CommandGene
BooleanClass, CharacterClass, DELTA, DoubleClass, FloatClass, IntegerClass, LongClass, nodeIndex, VoidClass
-
-
Constructor Summary
Constructors Constructor and Description Constant(GPConfiguration a_conf, java.lang.Class a_type, java.lang.Object a_value)Constant(GPConfiguration a_conf, java.lang.Class a_type, java.lang.Object a_value, int a_subReturnType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleexecute_double(ProgramChromosome c, int n, java.lang.Object[] args)Executes this node as a double.floatexecute_float(ProgramChromosome c, int n, java.lang.Object[] args)Executes this node as a float.intexecute_int(ProgramChromosome c, int n, java.lang.Object[] args)Executes this node as an integer.longexecute_long(ProgramChromosome c, int n, java.lang.Object[] args)Executes this node as a long.java.lang.Objectexecute_object(ProgramChromosome c, int n, java.lang.Object[] args)Executes this node as an object.java.lang.StringgetName()java.lang.StringtoString()-
Methods inherited from class org.jgap.gp.CommandGene
cleanup, compareTo, dynamizeArity, ensureUniqueness, ensureUniqueness, ensureUniqueness2, equals, execute_boolean, execute_void, execute, getAllele, getApplicationData, getArity, getChildType, getEnergy, getGPConfiguration, getPersistentRepresentation, getReturnType, getSubChildType, getSubChildTypes, getSubReturnType, hashCode, isAffectGlobalState, isCompareApplicationData, isFloatType, isIntegerType, isValid, isValid, setAllele, setApplicationData, setCompareApplicationData, setEnergy, setNoValidation, setReturnType, setToRandomValue, setValueFromPersistentRepresentation, size
-
-
-
-
Constructor Detail
-
Constant
public Constant(GPConfiguration a_conf, java.lang.Class a_type, java.lang.Object a_value) throws InvalidConfigurationException
- Throws:
InvalidConfigurationException
-
Constant
public Constant(GPConfiguration a_conf, java.lang.Class a_type, java.lang.Object a_value, int a_subReturnType) throws InvalidConfigurationException
- Throws:
InvalidConfigurationException
-
-
Method Detail
-
toString
public java.lang.String toString()
- Specified by:
toStringin classCommandGene- Returns:
- the string representation of the command. Especially usefull to output a resulting formula in human-readable form.
-
getName
public java.lang.String getName()
- Overrides:
getNamein classCommandGene- Returns:
- textual name of this command
- Since:
- 3.2
-
execute_int
public int execute_int(ProgramChromosome c, int n, java.lang.Object[] args)
Description copied from class:CommandGeneExecutes this node as an integer. Override to implement.- Overrides:
execute_intin classCommandGene- Parameters:
c- ignored heren- ignored hereargs- ignored here- Returns:
- nothing but exception
-
execute_long
public long execute_long(ProgramChromosome c, int n, java.lang.Object[] args)
Description copied from class:CommandGeneExecutes this node as a long. Override to implement.- Overrides:
execute_longin classCommandGene- Parameters:
c- ignored heren- ignored hereargs- ignored here- Returns:
- nothing but exception
-
execute_float
public float execute_float(ProgramChromosome c, int n, java.lang.Object[] args)
Description copied from class:CommandGeneExecutes this node as a float. Override to implement.- Overrides:
execute_floatin classCommandGene- Parameters:
c- ignored heren- ignored hereargs- ignored here- Returns:
- nothing but exception
-
execute_double
public double execute_double(ProgramChromosome c, int n, java.lang.Object[] args)
Description copied from class:CommandGeneExecutes this node as a double. Override to implement.- Overrides:
execute_doublein classCommandGene- Parameters:
c- ignored heren- ignored hereargs- 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:CommandGeneExecutes this node as an object. Override to implement.- Overrides:
execute_objectin classCommandGene- Parameters:
c- ignored heren- ignored hereargs- ignored here- Returns:
- nothing but exception
-
-
DMelt 3.0 © DataMelt by jWork.ORG