org.jgap.gp.terminal
Class NOP
- java.lang.Object
-
- org.jgap.gp.CommandGene
-
- org.jgap.gp.MathCommand
-
- org.jgap.gp.terminal.NOP
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable
public class NOP extends MathCommand
NO Operation. Does exactly nothing. Useful when a terminal with return type void is needed.- 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 NOP(GPConfiguration a_conf)NOP(GPConfiguration a_conf, java.lang.Class a_returnType, int a_subReturnType)NOP(GPConfiguration a_conf, int a_subReturnType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectexecute_object(ProgramChromosome c, int n, java.lang.Object[] args)Executes this node as an object.voidexecute_void(ProgramChromosome c, int n, java.lang.Object[] args)Executes this node, returning nothing.java.lang.StringgetName()java.lang.StringtoString()-
Methods inherited from class org.jgap.gp.CommandGene
cleanup, compareTo, dynamizeArity, ensureUniqueness, ensureUniqueness, ensureUniqueness2, equals, execute_boolean, execute_double, execute_float, execute_int, execute_long, 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
-
NOP
public NOP(GPConfiguration a_conf) throws InvalidConfigurationException
- Throws:
InvalidConfigurationException
-
NOP
public NOP(GPConfiguration a_conf, int a_subReturnType) throws InvalidConfigurationException
- Throws:
InvalidConfigurationException
-
NOP
public NOP(GPConfiguration a_conf, java.lang.Class a_returnType, 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_void
public void execute_void(ProgramChromosome c, int n, java.lang.Object[] args)
Description copied from class:CommandGeneExecutes this node, returning nothing. Override to implement.- Overrides:
execute_voidin classCommandGene- Parameters:
c- ignored heren- ignored hereargs- ignored here
-
execute_object
public java.lang.Object execute_object(ProgramChromosome c, int n, java.lang.Object[] args)
Executes this node as an object.- Overrides:
execute_objectin classCommandGene- Parameters:
c- ignored heren- ignored hereargs- ignored here- Returns:
- nothing but exception
- Throws:
java.lang.UnsupportedOperationException- Since:
- 3.2.1
-
-
DMelt 3.0 © DataMelt by jWork.ORG