![]() |
Quantum Fog
0.9.3
|
Public Member Functions | |
def | __init__ (self, id_num, name="blank") |
def | __lt__ (self, other) |
def | add_neighbor (self, node) |
def | remove_neighbor (self, node) |
def | has_neighbor (self, node) |
Public Attributes | |
id_num | |
topo_index | |
name | |
neighbors | |
visited | |
In its most basic form, a Graph is just a set of Node's. A BayesNode is a DirectNode is a Node. Similarly, a BayesNet is a Dag is a Graph. Attributes ---------- id_num : int Should be an int that is immutable and different for each node. topo_index : int Initially defined to be equal to id_num. After a topological sort, indices are permuted amongst the nodes so as to be in topological order, root nodes having lowest topo_index. name : str Optional, preferably different for each node. neighbors : set[Nodes] visited : bool
def nodes.Node.Node.__init__ | ( | self, | |
id_num, | |||
name = "blank" |
|||
) |
Constructor Parameters ---------- id_num : int name : str Returns -------
def nodes.Node.Node.__lt__ | ( | self, | |
other | |||
) |
Defines a < operator for Node's. Used in topological sorting. Parameters ---------- other : Node Returns ------- bool
def nodes.Node.Node.add_neighbor | ( | self, | |
node | |||
) |
Make 'node' a neighbor of self and vice versa if they aren't the same node. Parameters ---------- node : Node Returns ------- None
def nodes.Node.Node.has_neighbor | ( | self, | |
node | |||
) |
Check if 'node' is a neighbor. Parameters ---------- node : Node Returns ------- bool
def nodes.Node.Node.remove_neighbor | ( | self, | |
node | |||
) |
Remove 'node' from the list of neighbors, effectively deleting that edge from the graph. Parameters ---------- node : Node Returns ------- None