- All Superinterfaces:
Factory<G>
,FlatTree<A,
,G> Gene<A,
,G> Iterable<G>
,Self<G>
,Tree<A,
,G> Verifiable
- All Known Implementing Classes:
AbstractTreeGene
,ProgramGene
Representation of tree shaped gene. Since the genes are part of a chromosome,
they are implementing the
FlatTree
interface, which makes the required
storage layout explicit.- Since:
- 3.9
- Version:
- 6.0
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionnewInstance
(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, isEmpty, isLeaf, isRelated, isRoot, isSibling, iterator, lastChild, lastLeaf, leafCount, leaves, level, nextLeaf, nextNode, nextSibling, parent, path, pathElements, pathFromAncestorIterator, postorderIterator, postorderStream, preorderIterator, preorderStream, previousLeaf, previousNode, previousSibling, reduce, root, sharedAncestor, siblingCount, size, stream, toParenthesesString, toParenthesesString
Methods inherited from interface io.jenetics.util.Verifiable
isValid
-
Method Details
-
value
Description copied from interface:Tree
Return the value of the currentTree
node. The value may benull
. -
newInstance
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
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
-