Private
constructorCreate an instance of TreeGraphNode which will yield its entire sub-tree of all child nodes. This is used internally by itself and the public constructor to pass the cycle checking map, recursively determining subsequent child nodes.
The value for which to find the tree graph node reversal.
The maximum distance/orbit/branch length to travel.
Modulus used to devide n, iff n is equivalent to (0 mod P).
Factor by which to multiply n.
Value to add to the scaled value of n.
Checks if this node's value already occurred.
Create an instance of TreeGraphNode by directly passing it the values required to instantiate, intended to be used in testing by manually creating trees in reverse, by passing expected child nodes to their parents until the entire expected tree is created.
The expected sequence state; null, MAX_STOP_OUT_OF_BOUNDS, CYCLE_INIT or CYCLE_LENGTH.
The expected "Pre N/P" child node.
The expected "Pre aN+b" child node.
the tree graph node and its subtree, computed for the parameters provided.
FailedSaneParameterCheck Thrown if either P or a are 0.
Private
cycleA map of previous graph nodes which maps instances of TreeGraphNode to themselves, to enable cycle detection.
Readonly
nodeThe value of this node in the tree.
Readonly
preANplusBNodeThe "Pre aN+b" child of this node that is present if it exists and this is not a terminal node.
Readonly
preNDivPNodeThe "Pre N/P" child of this node that is always present if this is not a terminal node.
The terminal state; null if not a terminal node, MAX_STOP_OUT_OF_BOUNDS if the maxOrbitDistance has been reached, CYCLE_LENGTH if the node's value is found to have occured previously, or CYCLE_INIT, retroactively applied when a CYCLE_LENGTH state node is found.
Static
Readonly
emptyTraverse a tree and assign the cycle map manually on all nodes.
This will only confirm an equality if the whole subtree of both nodes, including node values, sequence states, and child nodes, checked recursively, are equal. It ignores the cycle checking map, which is purely a utility variable.
The TreeGraphNode with which to compare equality.
true, if the entire sub-trees are equal.
Static
newCreate an instance of TreeGraphNode which will yield its entire sub-tree of all child nodes.
The value for which to find the tree graph node reversal.
The maximum distance/orbit/branch length to travel.
Modulus used to devide n, iff n is equivalent to (0 mod P).
Factor by which to multiply n.
Value to add to the scaled value of n.
the tree graph node and its subtree, computed for the parameters provided.
FailedSaneParameterCheck Thrown if either P or a are 0.
Static
newThis is used internally by itself and the public constructor to pass the cycle checking map, recursively determining subsequent child nodes.
The value for which to find the tree graph node reversal.
The expected sequence state; null, MAX_STOP_OUT_OF_BOUNDS, CYCLE_INIT or CYCLE_LENGTH.
The expected "Pre N/P" child node.
The expected "Pre aN+b" child node.
the tree graph node and its subtree, where the subtrees are passed in.
FailedSaneParameterCheck Thrown if either P or a are 0.
Generated using TypeDoc
Nodes that form a "tree graph", structured as a tree, with their own node's value, as well as references to either possible child node, where a node can only ever have two children, as there are only ever two reverse values. Also records any possible "terminal sequence state", whether that be that the "orbit distance" has been reached, as an "out of bounds" stop, which is the regularly expected terminal state. Other terminal states possible however include the cycle state and cycle length (end) states.