pub struct Node { /* private fields */ }
Expand description
A Node
represents the top of a tree (or subtree) in the Hashlife data
structure. The state of Hashlife is stored in a Node
and its children
forming a state tree.
§Level
Each Node
has a level
where 0
is a leaf and
any positive number is a branch. Given a level ‘x’, it can be derived
that the node is x
nodes away from the leaf level. All leaves are on
the same level.
§Population
Each node has a population
informing how many living Automata::Alive
leaves this subtree constains. If the Node
is a leaf, then the
popilation can only be 1 or 0 respectively representing
Automata::Alive
or Automata::Dead
.
§Children
The Node
in a hashlife algorithm is known as a QuadTree where the node
points to four child nodes. The children field is an optional and is
None
only when it is a leaf node at level=0
.