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 theFlatTreeinterface, 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 GnewInstance(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, 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:TreeReturn the value of the currentTreenode. 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 thechildCountis 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 giventreenode isnull- Since:
- 6.0
-
-