getVariable() public method

public getVariable ( ) : String
return String
Esempio n. 1
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);
            }
        }
Esempio n. 2
0
 public void influencedBy(BayesNetNode parent1, BayesNetNode parent2)
 {
     influencedBy(parent1);
     influencedBy(parent2);
     distribution = new ProbabilityDistribution(parent1.getVariable(),
             parent2.getVariable());
 }
Esempio n. 3
0
 public void influencedBy(BayesNetNode parent1, BayesNetNode parent2)
 {
     influencedBy(parent1);
     influencedBy(parent2);
     distribution = new ProbabilityDistribution(parent1.getVariable(),
                                                parent2.getVariable());
 }
Esempio n. 4
0
 public void influencedBy(BayesNetNode parent1)
 {
     addParent(parent1);
     parent1.addChild(this);
     distribution = new ProbabilityDistribution(parent1.getVariable());
 }
Esempio n. 5
0
 public void influencedBy(BayesNetNode parent1)
 {
     addParent(parent1);
     parent1.addChild(this);
     distribution = new ProbabilityDistribution(parent1.getVariable());
 }