Example #1
0
 public void influencedBy(BayesNetNode parent1, BayesNetNode parent2)
 {
     influencedBy(parent1);
     influencedBy(parent2);
     distribution = new ProbabilityDistribution(parent1.getVariable(),
             parent2.getVariable());
 }
Example #2
0
        public bool isTrueFor(double probability,
                              Dictionary <String, bool> modelBuiltUpSoFar)
        {
            Dictionary <String, bool> conditions = new Dictionary <String, bool>();

            if (isRoot())
            {
                conditions.Add(getVariable(), true);
            }
            else
            {
                for (int i = 0; i < parents.Count; i++)
                {
                    BayesNetNode parent = parents[i];
                    conditions.Add(parent.getVariable(), modelBuiltUpSoFar[parent.getVariable()]);
                }
            }
            double trueProbability = probabilityOf(conditions);

            if (probability <= trueProbability)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
 public void influencedBy(BayesNetNode parent1, BayesNetNode parent2)
 {
     influencedBy(parent1);
     influencedBy(parent2);
     distribution = new ProbabilityDistribution(parent1.getVariable(),
                                                parent2.getVariable());
 }
Example #4
0
 private void addChild(BayesNetNode node)
 {
     if (!(children.Contains(node)))
     {
         children.Add(node);
     }
 }
Example #5
0
 //
 // PRIVATE METHODS
 //
 private void addParent(BayesNetNode node)
 {
     if (!(parents.Contains(node)))
     {
         parents.Add(node);
     }
 }
Example #6
0
        public override bool Equals(Object o)
        {
            if (this == o)
            {
                return(true);
            }
            if ((o == null) || (this.GetType() != o.GetType()))
            {
                return(false);
            }
            BayesNetNode another = (BayesNetNode)o;

            return(variable.Equals(another.variable));
        }
Example #7
0
 public void influencedBy(BayesNetNode parent1)
 {
     addParent(parent1);
     parent1.addChild(this);
     distribution = new ProbabilityDistribution(parent1.getVariable());
 }
Example #8
0
 private void addChild(BayesNetNode node)
 {
     if (!(children.Contains(node)))
     {
         children.Add(node);
     }
 }
Example #9
0
 //
 // PRIVATE METHODS
 //
 private void addParent(BayesNetNode node)
 {
     if (!(parents.Contains(node)))
     {
         parents.Add(node);
     }
 }
Example #10
0
 public void influencedBy(BayesNetNode parent1)
 {
     addParent(parent1);
     parent1.addChild(this);
     distribution = new ProbabilityDistribution(parent1.getVariable());
 }