예제 #1
0
 public void influencedBy(BayesNetNode parent1, BayesNetNode parent2)
 {
     influencedBy(parent1);
     influencedBy(parent2);
     distribution = new ProbabilityDistribution(parent1.getVariable(),
                                                parent2.getVariable());
 }
예제 #2
0
 public void influencedBy(BayesNetNode parent1, BayesNetNode parent2)
 {
     influencedBy(parent1);
     influencedBy(parent2);
     distribution = new ProbabilityDistribution(parent1.getVariable(),
             parent2.getVariable());
 }
예제 #3
0
 public BayesNetNode(String variable)
 {
     this.variable = variable;
     parents = new List<BayesNetNode>();
     children = new List<BayesNetNode>();
     distribution = new ProbabilityDistribution(variable);
 }
예제 #4
0
 public BayesNetNode(String variable)
 {
     this.variable = variable;
     parents       = new List <BayesNetNode>();
     children      = new List <BayesNetNode>();
     distribution  = new ProbabilityDistribution(variable);
 }
예제 #5
0
 internal Row(double probability, ProbabilityDistribution probabilityDistribution, params bool [] vals)
 {
     this.probabilityDistribution = probabilityDistribution;
     this.probability             = probability;
     values = new bool[vals.Length];
     System.Array.Copy(vals, 0, values, 0, vals.Length);
 }
예제 #6
0
        public static double[] ask(Query q, ProbabilityDistribution pd)
        {
            double[] probDist = new double[2];
            Dictionary<String, bool> h = q.getEvidenceVariables();

            // true probability
            h[q.getQueryVariable()] = true;
            probDist[0] = pd.probabilityOf(h);
            // false probability
            h[q.getQueryVariable()] = false;
            probDist[1] = pd.probabilityOf(h);
            return Util.normalize(probDist);
        }
예제 #7
0
 public void influencedBy(BayesNetNode parent1)
 {
     addParent(parent1);
     parent1.addChild(this);
     distribution = new ProbabilityDistribution(parent1.getVariable());
 }
예제 #8
0
 public void influencedBy(BayesNetNode parent1)
 {
     addParent(parent1);
     parent1.addChild(this);
     distribution = new ProbabilityDistribution(parent1.getVariable());
 }
 internal Row(double probability, ProbabilityDistribution probabilityDistribution, params bool [] vals)
 {
     this.probabilityDistribution = probabilityDistribution;
     this.probability = probability;
     values = new bool[vals.Length];
     System.Array.Copy(vals, 0, values, 0, vals.Length);
 }