aboutsummaryrefslogtreecommitdiff
path: root/beliefs/models/BernoulliOrModel.py
blob: bf2b44cb545970bdb67bda8f89964912ded2f72f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from beliefs.models.BayesianModel import BayesianModel
from beliefs.types.BernoulliOrNode import BernoulliOrNode


class BernoulliOrModel(BayesianModel):
    """
    BernoulliOrModel stores node instances of BernoulliOrNodes (Bernoulli
    variables associated with an OR conditional probability distribution).
    """
    def __init__(self, edges, nodes=None):
        """
        Input:
          edges: an edge list, e.g. [(parent1, child1), (parent1, child2)]
        """
        if nodes is None:
            nodes = self.create_nodes(edges, node_class=BernoulliOrNode)
        super().__init__(edges, nodes_dict=nodes)