Package io.jenetics.ext
Interface TreeGene<A,G extends TreeGene<A,G>>
-
- All Known Implementing Classes:
AbstractTreeGene
public interface TreeGene<A,G extends TreeGene<A,G>> extends Gene<A,G>, FlatTree<A,G>
Representation of tree shaped gene. Since the genes are part of a chromosome, they are implementing theFlatTree
interface, which makes the required storage layout explicit.- Since:
- 3.9
- Version:
- 6.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description G
newInstance(A allele, int childOffset, int childCount)
Return a new tree gene with the given allele and the local tree structure.default G
newInstance(FlatTree<? extends A,?> tree)
Return a new tree gene from the given flat tree node.default A
value()
Return the value of the currentTree
node.-
Methods inherited from interface io.jenetics.ext.util.FlatTree
childOffset, flattenedNodes
-
Methods inherited from interface io.jenetics.Gene
allele, newInstance, newInstance
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface io.jenetics.ext.util.Tree
breadthFirstIterator, breadthFirstStream, childAfter, childAt, childAtPath, childAtPath, childBefore, childCount, childIterator, childPath, childStream, depth, depthFirstIterator, depthFirstStream, firstChild, firstLeaf, identical, indexOf, isAncestor, isChild, isDescendant, isLeaf, isRelated, isRoot, isSibling, iterator, lastChild, lastLeaf, leafCount, level, nextLeaf, nextNode, nextSibling, parent, path, pathElements, pathFromAncestorIterator, postorderIterator, postorderStream, preorderIterator, preorderStream, previousLeaf, previousNode, previousSibling, root, sharedAncestor, siblingCount, size, stream, toParenthesesString, toParenthesesString
-
Methods inherited from interface io.jenetics.util.Verifiable
isValid
-
-
-
-
Method Detail
-
value
default A value()
Description copied from interface:Tree
Return the value of the currentTree
node. The value may benull
.
-
newInstance
G newInstance(A allele, int childOffset, int childCount)
Return a new tree gene with the given allele and the local tree structure.- Parameters:
allele
- the actual gene allelechildOffset
- the offset of the first node child within the chromosomechildCount
- the number of children of the new tree gene- Returns:
- a new tree gene with the given parameters
- Throws:
IllegalArgumentException
- if thechildCount
is smaller than zero
-
newInstance
default G newInstance(FlatTree<? extends A,?> tree)
Return a new tree gene from the given flat tree node.- Parameters:
tree
- the flat tree node- Returns:
- a new tree gene from the given flat tree node
- Throws:
NullPointerException
- if the giventree
node isnull
- Since:
- 6.0
-
-