Package aima.core.probability.util

Examples of aima.core.probability.util.ProbabilityTable.iterateOverTable()


        Q.setValue(cnt,
            enumerateAll(bn.getVariablesInTopologicalOrder(), e));
        cnt++;
      }
    };
    Q.iterateOverTable(di);

    // return NORMALIZE(Q(X))
    return Q.normalize();
  }
View Full Code Here


      public Object getPostIterateValue() {
        return null; // N/A
      }
    };
    Q.iterateOverTable(di);

    // return NORMALIZE(Q(X))
    return Q.normalize();
  }
View Full Code Here

      public Object getPostIterateValue() {
        return probSum;
      }
    };
    d.iterateOverTable(di);

    return ((Double) di.getPostIterateValue()).doubleValue();
  }

  public double posterior(Proposition phi, Proposition... evidence) {
View Full Code Here

        return null; // N/A
      }
    };

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(aRV, true));
    Assert.assertEquals(1111.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(aRV, false));
    Assert.assertEquals(11110000.0, sumOf(answer), DELTA_THRESHOLD);
View Full Code Here

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(aRV, true));
    Assert.assertEquals(1111.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(aRV, false));
    Assert.assertEquals(11110000.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(bRV, true));
    Assert.assertEquals(110011.0, sumOf(answer), DELTA_THRESHOLD);
View Full Code Here

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(aRV, false));
    Assert.assertEquals(11110000.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(bRV, true));
    Assert.assertEquals(110011.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(bRV, false));
    Assert.assertEquals(11001100.0, sumOf(answer), DELTA_THRESHOLD);
View Full Code Here

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(bRV, true));
    Assert.assertEquals(110011.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(bRV, false));
    Assert.assertEquals(11001100.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(cRV, true));
    Assert.assertEquals(1010101.0, sumOf(answer), DELTA_THRESHOLD);
View Full Code Here

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(bRV, false));
    Assert.assertEquals(11001100.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(cRV, true));
    Assert.assertEquals(1010101.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(cRV, false));
    Assert.assertEquals(10101010.0, sumOf(answer), DELTA_THRESHOLD);
View Full Code Here

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(cRV, true));
    Assert.assertEquals(1010101.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(cRV, false));
    Assert.assertEquals(10101010.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(bRV, true),
        new AssignmentProposition(cRV, true));
View Full Code Here

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(cRV, false));
    Assert.assertEquals(10101010.0, sumOf(answer), DELTA_THRESHOLD);

    answer.clear();
    ptABC.iterateOverTable(pti, new AssignmentProposition(bRV, true),
        new AssignmentProposition(cRV, true));
    Assert.assertEquals(10001.0, sumOf(answer), DELTA_THRESHOLD);
  }

  //
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.