aima/probability.py
def add(self, node_spec):
        """Add a node to the net. Its parents must already be in the
        net, and its variable must not."""
        node = BayesNode(*node_spec)
        assert node.variable not in self.vars
        assert every(lambda parent: parent in self.vars, node.parents)
        self.nodes.append(node)
        self.vars.append(node.variable)
        for parent in node.parents:
            self.variable_node(parent).children.append(node)
def add(self, node_spec):
        """Add a node to the net. Its parents must already be in the
        net, and its variable must not."""
        node = BayesNode(*node_spec)
        assert node.variable not in self.vars
        assert every(lambda parent: parent in self.vars, node.parents)
        self.nodes.append(node)
        self.vars.append(node.variable)
        for parent in node.parents:
            self.variable_node(parent).children.append(node)
def add ( self , node_spec ) : node = BayesNode ( * node_spec ) assert node . variable not in self . vars assert every ( lambda parent : parent in self . vars , node . parents ) self . nodes . append ( node ) self . vars . append ( node . variable ) for parent in node . parents : self . variable_node ( parent ) . children . append ( node )
Add a node to the net. Its parents must already be in the
        net, and its variable must not.
Add a node to the net . Its parents must already be in the net and its variable must not .