|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--gpsys.GeneBranch
A GeneBranch defines a Gene subtree of a GP Gene tree. It has instance variables defining the parent Gene of this subtree, and where it is referenced in the parent. The GeneBranch provides suffiecient information to allow a subtree to be replaced by another one. The latter could be generated either by creation (for mutation) or crossover.
| Field Summary | |
Gene |
child
The Gene subtree itself. |
static long |
functionCount
Total number of times a function point was selected for mutation or crossover. |
int |
index
The arguments index of this Gene subtree in the parent Gene. |
Gene |
parent
The parent of the Gene subtree. |
static long |
terminalCount
Total number of times a terminal point was selected for mutation or crossover. |
static int |
TYPE_VECTOR_SIZE
The default size of the vector used for keeping subtrees of a given type. |
| Constructor Summary | |
private |
GeneBranch(Gene parent,
int index,
Gene child)
Construct a GeneBranch using the supplied arguments to initialise the instance variables. |
|
GeneBranch(java.util.Random rng,
Gene treeTop)
select a subtree at random from the given tree. |
|
GeneBranch(java.util.Random rng,
Gene treeTop,
Type type)
select a subtree of a given type at random from the given tree. |
| Method Summary | |
static void |
branchesOfType(Gene parent,
int index,
Gene child,
Type type,
java.util.Vector terminalBranches,
java.util.Vector functionBranches)
Get a table of all subtrees of a given type. |
void |
selectBranch(java.util.Random rng,
Gene tree,
Type type)
select a subtree of at random from the given tree. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public Gene parent
public int index
public Gene child
public static final int TYPE_VECTOR_SIZE
public static long functionCount
public static long terminalCount
| Constructor Detail |
private GeneBranch(Gene parent,
int index,
Gene child)
parent - the parent of this subtree.index - the arguments index of this Gene subtree in the
parent Gene.child - the subtree itself.
public GeneBranch(java.util.Random rng,
Gene treeTop)
rng - the random number generator to be used.treeTop - the tree from which to select a subtree.
public GeneBranch(java.util.Random rng,
Gene treeTop,
Type type)
rng - the random number generator to be used.treeTop - the tree from which to select a subtree.type - the type of the subtree to be selected.| Method Detail |
public void selectBranch(java.util.Random rng,
Gene tree,
Type type)
rng - the random number generator to be used.tree - the tree from which to select a subtree.
public static void branchesOfType(Gene parent,
int index,
Gene child,
Type type,
java.util.Vector terminalBranches,
java.util.Vector functionBranches)
parent - the parent Gene of the child.index - the arguments index of the child in the parent.child - the child Gene subtree.type - the type of subtree required (null if don't care).terminalBranches - the table of subtrees that are terminals.functionBranches - the table of subtrees that are functions.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||