All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.GeneBranch
java.lang.Object
|
+----gpsys.GeneBranch
- public class GeneBranch
- extends Object
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.
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
-
child
- The Gene subtree itself.
-
index
- The arguments index of this Gene subtree in the parent Gene.
-
parent
- The parent of the Gene subtree.
-
TYPE_VECTOR_SIZE
- The default size of the vector used for keeping subtrees of a given type.
-
GeneBranch(Random, Gene)
- select a subtree at random from the given tree.
-
GeneBranch(Random, Gene, Type)
- select a subtree of a given type at random from the given tree.
-
branchesOfType(Gene, int, Gene, Type, Vector)
- Get a table of all subtrees of a given type
-
selectBranch(Random, Gene)
- select a subtree of at random from the given tree.
-
selectBranch(Random, Gene, Type)
- select a subtree of at random from the given tree.
parent
public Gene parent
- The parent of the Gene subtree.
index
public int index
- The arguments index of this Gene subtree in the parent Gene.
child
public Gene child
- The Gene subtree itself.
TYPE_VECTOR_SIZE
public static final int TYPE_VECTOR_SIZE
- The default size of the vector used for keeping subtrees of a given type.
GeneBranch
public GeneBranch(Random rng,
Gene treeTop)
- select a subtree at random from the given tree.
- Parameters:
- rng - the random number generator to be used.
- treeTop - the tree from which to select a subtree.
GeneBranch
public GeneBranch(Random rng,
Gene treeTop,
Type type)
- select a subtree of a given type at random from the given tree.
- Parameters:
- 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.
selectBranch
public void selectBranch(Random rng,
Gene tree)
- select a subtree of at random from the given tree. Initialise the
instance variable to reflect the selected tree.
- Parameters:
- rng - the random number generator to be used.
- tree - the tree from which to select a subtree.
selectBranch
public void selectBranch(Random rng,
Gene tree,
Type type)
- select a subtree of at random from the given tree. Initialise the
instance variable to reflect the selected tree.
- Parameters:
- rng - the random number generator to be used.
- tree - the tree from which to select a subtree.
branchesOfType
public static void branchesOfType(Gene parent,
int index,
Gene child,
Type type,
Vector branches)
- Get a table of all subtrees of a given type
- Parameters:
- 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.
- branches - the table of subtrees.
All Packages Class Hierarchy This Package Previous Next Index