Examples of numberOfParticlesWithState()


Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

  public void testFilteringWithParticleSetsForRobotHmm() {
    Randomizer r = new MockRandomizer(new double[] { 0.1, 0.2, 0.3, 0.4,
        0.5, 0.6, 0.7, 0.8, 0.9 });
    ParticleSet starting = robot.prior().toParticleSet(robot, r, 100);
    Assert.assertEquals(56,
        starting.numberOfParticlesWithState(HmmConstants.DOOR_OPEN));
    Assert.assertEquals(44,
        starting.numberOfParticlesWithState(HmmConstants.DOOR_CLOSED));

    // step one = robot takes no action but senses open door
    ParticleSet afterStepOne = starting.filter(HmmConstants.SEE_DOOR_OPEN,
View Full Code Here

Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

        0.5, 0.6, 0.7, 0.8, 0.9 });
    ParticleSet starting = robot.prior().toParticleSet(robot, r, 100);
    Assert.assertEquals(56,
        starting.numberOfParticlesWithState(HmmConstants.DOOR_OPEN));
    Assert.assertEquals(44,
        starting.numberOfParticlesWithState(HmmConstants.DOOR_CLOSED));

    // step one = robot takes no action but senses open door
    ParticleSet afterStepOne = starting.filter(HmmConstants.SEE_DOOR_OPEN,
        r);
    Assert.assertEquals(66,
View Full Code Here

Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

    // step one = robot takes no action but senses open door
    ParticleSet afterStepOne = starting.filter(HmmConstants.SEE_DOOR_OPEN,
        r);
    Assert.assertEquals(66,
        afterStepOne.numberOfParticlesWithState(HmmConstants.DOOR_OPEN));
    Assert.assertEquals(34, afterStepOne
        .numberOfParticlesWithState(HmmConstants.DOOR_CLOSED));

    // step two = robot pushes the door and then senses open door
    ParticleSet afterStepTwo = starting.filter(HmmConstants.PUSH_DOOR,
View Full Code Here

Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

    // step one = robot takes no action but senses open door
    ParticleSet afterStepOne = starting.filter(HmmConstants.SEE_DOOR_OPEN,
        r);
    Assert.assertEquals(66,
        afterStepOne.numberOfParticlesWithState(HmmConstants.DOOR_OPEN));
    Assert.assertEquals(34, afterStepOne
        .numberOfParticlesWithState(HmmConstants.DOOR_CLOSED));

    // step two = robot pushes the door and then senses open door
    ParticleSet afterStepTwo = starting.filter(HmmConstants.PUSH_DOOR,
        HmmConstants.SEE_DOOR_OPEN, r);
View Full Code Here

Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

    // step two = robot pushes the door and then senses open door
    ParticleSet afterStepTwo = starting.filter(HmmConstants.PUSH_DOOR,
        HmmConstants.SEE_DOOR_OPEN, r);
    Assert.assertEquals(100,
        afterStepTwo.numberOfParticlesWithState(HmmConstants.DOOR_OPEN));
    Assert.assertEquals(0, afterStepTwo
        .numberOfParticlesWithState(HmmConstants.DOOR_CLOSED));
  }

  @Test
View Full Code Here

Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

    // step two = robot pushes the door and then senses open door
    ParticleSet afterStepTwo = starting.filter(HmmConstants.PUSH_DOOR,
        HmmConstants.SEE_DOOR_OPEN, r);
    Assert.assertEquals(100,
        afterStepTwo.numberOfParticlesWithState(HmmConstants.DOOR_OPEN));
    Assert.assertEquals(0, afterStepTwo
        .numberOfParticlesWithState(HmmConstants.DOOR_CLOSED));
  }

  @Test
  public void testRandomVariableConversionToParticleSet() {
View Full Code Here

Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

  @Test
  public void testRandomVariableConversionToParticleSet() {
    VarDistribution rv = rainman.prior();
    ParticleSet ps = rv.toParticleSet(rainman, randomizer, 10);
    Assert.assertEquals(5,
        ps.numberOfParticlesWithState(HmmConstants.RAINING));
    Assert.assertEquals(5,
        ps.numberOfParticlesWithState(HmmConstants.NOT_RAINING));
  }

  @Test
View Full Code Here

Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

    VarDistribution rv = rainman.prior();
    ParticleSet ps = rv.toParticleSet(rainman, randomizer, 10);
    Assert.assertEquals(5,
        ps.numberOfParticlesWithState(HmmConstants.RAINING));
    Assert.assertEquals(5,
        ps.numberOfParticlesWithState(HmmConstants.NOT_RAINING));
  }

  @Test
  public void testParticleSetConversionToRandomVariable() {
View Full Code Here

Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

    VarDistribution rv = particleSet.toRandomVariable();
    Randomizer r = new MockRandomizer(new double[] { 0.1, 0.2, 0.3, 0.4,
        0.9 });
    ParticleSet ps2 = rv.toParticleSet(rainman, r, 10);
    Assert.assertEquals(8,
        ps2.numberOfParticlesWithState(HmmConstants.RAINING));
    Assert.assertEquals(2,
        ps2.numberOfParticlesWithState(HmmConstants.NOT_RAINING));
  }

  @Test
View Full Code Here

Examples of aima.core.probability.hmm.ParticleSet.numberOfParticlesWithState()

        0.9 });
    ParticleSet ps2 = rv.toParticleSet(rainman, r, 10);
    Assert.assertEquals(8,
        ps2.numberOfParticlesWithState(HmmConstants.RAINING));
    Assert.assertEquals(2,
        ps2.numberOfParticlesWithState(HmmConstants.NOT_RAINING));
  }

  @Test
  public void testTransitionModelGeneratesNewStateWhenGivenOldStateAndProbability() {
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.