Class gpjpp.GPGeneReference
All Packages Class Hierarchy This Package Previous Next Index
Class gpjpp.GPGeneReference
java.lang.Object
|
+----gpjpp.GPGeneReference
- public class GPGeneReference
- extends Object
Encapsulates the input and output parameters to the tree search
routines used for crossover and mutation. This class is needed
because Java cannot compute the address of a variable. The
functions in gpc++ that take the address of a pointer in order to
update a tree cannot be directly ported to Java. Instead, gpjpp
maintains the container and index within the container of each
gene being searched. This effectively provides the address of the
gene itself and makes it possible to replace the gene with a
gene branch from another source.
This class is for internal use.
- Version:
- 1.0
-
container
- The container that holds a particular gene.
-
count
- Used by a search function to count the number of
genes to pass or the number that were passed.
-
index
- The index of a particular gene within its container.
-
GPGeneReference()
- Instantiates a gene reference for later use.
-
GPGeneReference(GPContainer, int)
- Instantiates a gene reference with a known container and index.
-
GPGeneReference(GPGeneReference)
- Clones another gene reference.
-
assignContainer(GPContainer, int)
- Assigns a particular container and index to this gene reference.
-
assignRef(GPGeneReference)
- Assigns another gene reference to this one.
-
getGene()
- Returns the gene referenced by this class.
-
putGene(GPGene)
- Puts a different gene into the place of this class.
container
public GPContainer container
- The container that holds a particular gene.
index
public int index
- The index of a particular gene within its container.
count
public int count
- Used by a search function to count the number of
genes to pass or the number that were passed.
GPGeneReference
public GPGeneReference()
- Instantiates a gene reference for later use.
GPGeneReference
public GPGeneReference(GPContainer container,
int index)
- Instantiates a gene reference with a known container and index.
GPGeneReference
public GPGeneReference(GPGeneReference ref)
- Clones another gene reference.
assignRef
public void assignRef(GPGeneReference ref)
- Assigns another gene reference to this one.
assignContainer
public void assignContainer(GPContainer container,
int index)
- Assigns a particular container and index to this gene reference.
getGene
public GPGene getGene()
- Returns the gene referenced by this class.
putGene
public void putGene(GPGene g)
- Puts a different gene into the place of this class.
All Packages Class Hierarchy This Package Previous Next Index