- 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 GnewInstance(FlatTree<? extends A, ?> tree) Return a new tree gene from the given flat tree node.default Avalue()Return the value of the currentTreenode.Methods inherited from interface io.jenetics.ext.util.FlatTree
childOffset, flattenedNodesMethods inherited from interface io.jenetics.Gene
allele, newInstance, newInstanceMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods 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, toParenthesesStringMethods inherited from interface io.jenetics.util.Verifiable
isValid
-
Method Details
-
value
Description copied from interface:TreeReturn the value of the currentTreenode. 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 thechildCountis 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 giventreenode isnull- Since:
- 6.0
-