Examples of RandVar


Examples of aima.core.probability.util.RandVar

    final CategoricalDistribution s1 = new ProbabilityTable(f1_t.getFor());
    // Set up required working variables
    Proposition[] props = new Proposition[s1.getFor().size()];
    int i = 0;
    for (RandomVariable rv : s1.getFor()) {
      props[i] = new RandVar(rv.getName(), rv.getDomain());
      i++;
    }
    final Proposition Xtp1 = ProbUtil.constructConjunction(props);
    final AssignmentProposition[] xt = new AssignmentProposition[tToTm1StateVarMap
        .size()];
View Full Code Here

Examples of aima.core.probability.util.RandVar

    // Set up required working variables
    Proposition[] props = new Proposition[b_kp1t.getFor().size()];
    int i = 0;
    for (RandomVariable rv : b_kp1t.getFor()) {
      RandomVariable prv = tToTm1StateVarMap.get(rv);
      props[i] = new RandVar(prv.getName(), prv.getDomain());
      i++;
    }
    final Proposition Xk = ProbUtil.constructConjunction(props);
    final AssignmentProposition[] ax_kp1 = new AssignmentProposition[tToTm1StateVarMap
        .size()];
View Full Code Here

Examples of aima.core.probability.util.RandVar

      }
    }

    sensorModel = new FiniteBayesModel(dbn, new EliminationAsk());

    sampleIndexes = new RandVar("SAMPLE_INDEXES", new FiniteIntegerDomain(
        indexes));
  }
View Full Code Here

Examples of aima.core.probability.util.RandVar

public class CPTTest {
  public static final double DELTA_THRESHOLD = ProbabilityModel.DEFAULT_ROUNDING_THRESHOLD;

  @Test
  public void test_getConditioningCase() {
    RandVar aRV = new RandVar("A", new BooleanDomain());
    RandVar bRV = new RandVar("B", new BooleanDomain());
    RandVar cRV = new RandVar("C", new BooleanDomain());

    CPT cpt = new CPT(cRV, new double[] {
        // A = true, B = true, C = true
        0.1,
        // A = true, B = true, C = false
View Full Code Here

Examples of aima.core.probability.util.RandVar

public class ProbUtilTest {

  @Test
  public void test_indexOf() {
    RandVar X = new RandVar("X", new BooleanDomain());
    RandVar Y = new RandVar("Y", new ArbitraryTokenDomain("A", "B", "C"));
    RandVar Z = new RandVar("Z", new BooleanDomain());

    // An ordered X,Y,Z enumeration of values should look like:
    // 00: true, A, true
    // 01: true, A, false
    // 02: true, B, true
View Full Code Here

Examples of aima.core.probability.util.RandVar

    Assert.assertEquals(11, ProbUtil.indexOf(vars, event));
  }

  @Test
  public void test_indexesOfValue() {
    RandVar X = new RandVar("X", new BooleanDomain());
    RandVar Y = new RandVar("Y", new ArbitraryTokenDomain("A", "B", "C"));
    RandVar Z = new RandVar("Z", new BooleanDomain());

    // An ordered X,Y,Z enumeration of values should look like:
    // 00: true, A, true
    // 01: true, A, false
    // 02: true, B, true
View Full Code Here

Examples of aima.core.probability.util.RandVar

public class ProbabilityTableTest {
  public static final double DELTA_THRESHOLD = ProbabilityModel.DEFAULT_ROUNDING_THRESHOLD;

  @Test
  public void test_divideBy() {
    RandomVariable xRV = new RandVar("X", new BooleanDomain());
    RandomVariable yRV = new RandVar("Y", new BooleanDomain());
    RandomVariable zRV = new RandVar("Z", new BooleanDomain());

    ProbabilityTable xyzD = new ProbabilityTable(new double[] {
        // X = true, Y = true, Z = true
        1.0,
        // X = true, Y = true, Z = false
View Full Code Here

Examples of aima.core.probability.util.RandVar

            .getValues(), DELTA_THRESHOLD);
  }

  @Test
  public void test_pointwiseProduct() {
    RandomVariable xRV = new RandVar("X", new BooleanDomain());
    RandomVariable yRV = new RandVar("Y", new BooleanDomain());
    RandomVariable zRV = new RandVar("Z", new BooleanDomain());

    ProbabilityTable xyD = new ProbabilityTable(new double[] {
        // X = true, Y = true
        1.0,
        // X = true, Y = false
View Full Code Here

Examples of aima.core.probability.util.RandVar

        DELTA_THRESHOLD);
  }

  @Test
  public void test_pointwiseProductPOS() {
    RandomVariable xRV = new RandVar("X", new BooleanDomain());
    RandomVariable yRV = new RandVar("Y", new BooleanDomain());
    RandomVariable zRV = new RandVar("Z", new BooleanDomain());

    ProbabilityTable xyD = new ProbabilityTable(new double[] {
        // X = true, Y = true
        1.0,
        // X = true, Y = false
View Full Code Here

Examples of aima.core.probability.util.RandVar

        DELTA_THRESHOLD);
  }

  @Test
  public void test_iterateOverTable_fixedValues() {
    RandVar aRV = new RandVar("A", new BooleanDomain());
    RandVar bRV = new RandVar("B", new BooleanDomain());
    RandVar cRV = new RandVar("C", new BooleanDomain());
    ProbabilityTable ptABC = new ProbabilityTable(new double[] {
        // A = true, B = true, C = true
        1.0,
        // A = true, B = true, C = false
        10.0,
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.