Examples of toParticleSet()


Examples of aima.core.probability.hmm.VarDistribution.toParticleSet()

  }

  @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));
  }
View Full Code Here

Examples of aima.core.probability.hmm.VarDistribution.toParticleSet()

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