|
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.function.ReplaceInMatrix
public class ReplaceInMatrix
Replaces occurrences of specified characters in a two-dimensional matrix with a given other character. Returns the number of replacements.
| Nested Class Summary | |
|---|---|
static class |
ReplaceInMatrix.ReplacementMode
|
| 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 | |
|---|---|
ReplaceInMatrix(GPConfiguration a_conf,
java.lang.String a_matrixName,
ReplaceInMatrix.ReplacementMode a_mode,
java.lang.String a_targetCharacters,
char a_replacement)
|
|
ReplaceInMatrix(GPConfiguration a_conf,
java.lang.String a_matrixName,
ReplaceInMatrix.ReplacementMode a_mode,
java.lang.String a_targetCharacters,
char a_replacement,
int a_subChildType)
Allows setting a sub child type. |
|
| Method Summary | |
|---|---|
CommandGene |
applyMutation(int index,
double a_percentage)
Mutates a CommandGene. |
java.lang.Object |
clone()
Clones the object. |
int |
compareTo(java.lang.Object a_other)
The compareTo-method. |
boolean |
equals(java.lang.Object a_other)
The equals-method. |
int |
execute_int(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node as an integer. |
void |
execute_void(ProgramChromosome c,
int n,
java.lang.Object[] args)
Executes this node, returning nothing. |
java.lang.Class |
getChildType(IGPProgram a_ind,
int a_chromNum)
Determines which type a specific child of this command has. |
java.lang.String |
getName()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ReplaceInMatrix(GPConfiguration a_conf,
java.lang.String a_matrixName,
ReplaceInMatrix.ReplacementMode a_mode,
java.lang.String a_targetCharacters,
char a_replacement)
throws InvalidConfigurationException
InvalidConfigurationException
public ReplaceInMatrix(GPConfiguration a_conf,
java.lang.String a_matrixName,
ReplaceInMatrix.ReplacementMode a_mode,
java.lang.String a_targetCharacters,
char a_replacement,
int a_subChildType)
throws InvalidConfigurationException
a_conf - the configuration to usea_matrixName - name of the matrixa_mode - how to replace characters in the matrixa_targetCharacters - the characters to be replaceda_replacement - the character to replace others witha_subChildType - int
InvalidConfigurationException| Method Detail |
|---|
public java.lang.String toString()
toString in class CommandGenepublic java.lang.String getName()
getName in class CommandGene
public java.lang.Class getChildType(IGPProgram a_ind,
int a_chromNum)
getChildType in class CommandGenea_ind - ignored herea_chromNum - index of child
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 void execute_void(ProgramChromosome c,
int n,
java.lang.Object[] args)
CommandGene
execute_void in class CommandGenec - ignored heren - ignored hereargs - ignored herepublic int compareTo(java.lang.Object a_other)
compareTo in interface java.lang.ComparablecompareTo in class CommandGenea_other - the other object to compare
public boolean equals(java.lang.Object a_other)
equals in class CommandGenea_other - the other object to compare
public java.lang.Object clone()
clone in interface ICloneableclone in class java.lang.Object
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)
InvalidConfigurationException
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||