|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgap.gp.CommandGene
org.jgap.gp.terminal.Terminal
public class Terminal
A terminal is a static number that can be mutated.
| 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 | |
|---|---|
Terminal()
|
|
Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType)
|
|
Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType,
double a_minValue,
double a_maxValue)
Constructor. |
|
Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType,
double a_minValue,
double a_maxValue,
boolean a_wholeNumbers)
Constructor. |
|
Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType,
double a_minValue,
double a_maxValue,
boolean a_wholeNumbers,
int a_subReturnType)
|
|
Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType,
double a_minValue,
double a_maxValue,
boolean a_wholeNumbers,
int a_subReturnType,
boolean a_randomize)
|
|
| Method Summary | |
|---|---|
CommandGene |
applyMutation(int index,
double a_percentage)
Mutates a CommandGene. |
java.lang.Object |
clone()
Clones the object. |
double |
execute_double(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as a double. |
float |
execute_float(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as a float. |
int |
execute_int(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as an integer. |
long |
execute_long(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as a long. |
java.lang.Object |
execute_object(ProgramChromosome c,
int n,
java.lang.Object[] args)
Returns a string representation of the terminal. |
java.lang.Class |
getChildType(IGPProgram a_ind,
int a_chromNum)
Gets the type of node allowed from the given child number. |
protected void |
setRandomValue()
|
protected void |
setRandomValue(double a_value)
|
protected void |
setRandomValue(float a_value)
|
protected void |
setRandomValue(int a_value)
|
protected void |
setRandomValue(long a_value)
|
void |
setValue(double a_value)
|
void |
setValue(float a_value)
|
void |
setValue(int a_value)
|
void |
setValue(long a_value)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Terminal()
throws InvalidConfigurationException
InvalidConfigurationException
public Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType)
throws InvalidConfigurationException
InvalidConfigurationException
public Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType,
double a_minValue,
double a_maxValue)
throws InvalidConfigurationException
a_conf - GPConfigurationa_returnType - Classa_minValue - doublea_maxValue - double
InvalidConfigurationException
public Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType,
double a_minValue,
double a_maxValue,
boolean a_wholeNumbers)
throws InvalidConfigurationException
a_conf - GPConfigurationa_returnType - Classa_minValue - doublea_maxValue - doublea_wholeNumbers - true: only return whole numbers (only relevant when
using type double or float)
InvalidConfigurationException
public Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType,
double a_minValue,
double a_maxValue,
boolean a_wholeNumbers,
int a_subReturnType)
throws InvalidConfigurationException
InvalidConfigurationException
public Terminal(GPConfiguration a_conf,
java.lang.Class a_returnType,
double a_minValue,
double a_maxValue,
boolean a_wholeNumbers,
int a_subReturnType,
boolean a_randomize)
throws InvalidConfigurationException
a_conf - GPConfigurationa_returnType - Classa_minValue - doublea_maxValue - doublea_wholeNumbers - booleana_subReturnType - inta_randomize - true: randomize initial value
InvalidConfigurationException| Method Detail |
|---|
protected void setRandomValue(int a_value)
protected void setRandomValue(long a_value)
protected void setRandomValue(double a_value)
protected void setRandomValue(float a_value)
protected void setRandomValue()
public void setValue(double a_value)
public void setValue(float a_value)
public void setValue(int a_value)
public void setValue(long a_value)
public CommandGene applyMutation(int index,
double a_percentage)
throws InvalidConfigurationException
IMutateable
applyMutation in interface IMutateableindex - references the part of a multipart object, normally not
relevanta_percentage - the mutation rate (0.0 to 1.0)
InvalidConfigurationExceptionpublic java.lang.String toString()
toString in class CommandGene
public int execute_int(ProgramChromosome c,
int n,
java.lang.Object[] args)
CommandGene
execute_int in class CommandGenec - ignored heren - ignored hereargs - ignored here
public long execute_long(ProgramChromosome c,
int n,
java.lang.Object[] args)
CommandGene
execute_long in class CommandGenec - ignored heren - ignored hereargs - ignored here
public float execute_float(ProgramChromosome c,
int n,
java.lang.Object[] args)
CommandGene
execute_float in class CommandGenec - ignored heren - ignored hereargs - ignored here
public double execute_double(ProgramChromosome c,
int n,
java.lang.Object[] args)
CommandGene
execute_double in class CommandGenec - ignored heren - ignored hereargs - ignored here
public java.lang.Object execute_object(ProgramChromosome c,
int n,
java.lang.Object[] args)
execute_object in class CommandGenec - ignored heren - ignored hereargs - ignored here
public java.lang.Class getChildType(IGPProgram a_ind,
int a_chromNum)
CommandGene
getChildType in class CommandGenea_ind - the individual the child belongs toa_chromNum - the chromosome number
public java.lang.Object clone()
clone in interface ICloneableclone in class java.lang.Object
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||