Package aima.core.util.math

Examples of aima.core.util.math.MixedRadixNumber.intValue()


      for (RVInfo rvInfo : randomVarInfo.values()) {
        possibleWorld.put(rvInfo.getVariable(), rvInfo
            .getDomainValueAt(mrn.getCurrentNumeralValue(rvInfo
                .getRadixIdx())));
      }
      pti.iterate(possibleWorld, values[mrn.intValue()]);

    } while (mrn.increment());
  }

  /**
 
View Full Code Here


      for (RVInfo rvInfo : randomVarInfo.values()) {
        possibleWorld.put(rvInfo.getVariable(), rvInfo
            .getDomainValueAt(mrn.getCurrentNumeralValue(rvInfo
                .getRadixIdx())));
      }
      pti.iterate(possibleWorld, values[mrn.intValue()]);

    } while (mrn.increment());
  }

  /**
 
View Full Code Here

      i++;
    }
    while (mrn.decrement()) {
      i--;
    }
    Assert.assertEquals(i, mrn.intValue());
  }

  @Test
  public void testCurrentNumberalValue() {
    MixedRadixNumber mrn;
View Full Code Here

  public void testSetCurrentValueFor() {
    MixedRadixNumber mrn;
    //
    mrn = new MixedRadixNumber(0, new int[] { 3, 3, 2, 2 });
    mrn.setCurrentValueFor(new int[] { 0, 0, 0, 0 });
    Assert.assertEquals(0, mrn.intValue());
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(0));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(1));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(3));
    //
View Full Code Here

    Assert.assertEquals(0, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(3));
    //
    mrn = new MixedRadixNumber(0, new int[] { 3, 3, 2, 2 });
    mrn.setCurrentValueFor(new int[] { 2, 2, 1, 1 });
    Assert.assertEquals(35, mrn.intValue());
    Assert.assertEquals(2, mrn.getCurrentNumeralValue(0));
    Assert.assertEquals(2, mrn.getCurrentNumeralValue(1));
    Assert.assertEquals(1, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(1, mrn.getCurrentNumeralValue(3));
    //
View Full Code Here

    Assert.assertEquals(1, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(1, mrn.getCurrentNumeralValue(3));
    //
    mrn = new MixedRadixNumber(0, new int[] { 3, 3, 2, 2 });
    mrn.setCurrentValueFor(new int[] { 1, 2, 0, 1 });
    Assert.assertEquals(25, mrn.intValue());
    Assert.assertEquals(1, mrn.getCurrentNumeralValue(0));
    Assert.assertEquals(2, mrn.getCurrentNumeralValue(1));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(1, mrn.getCurrentNumeralValue(3));
    //
View Full Code Here

    Assert.assertEquals(0, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(1, mrn.getCurrentNumeralValue(3));
    //
    mrn = new MixedRadixNumber(0, new int[] { 3, 3, 2, 2 });
    mrn.setCurrentValueFor(new int[] { 2, 2, 1, 0 });
    Assert.assertEquals(17, mrn.intValue());
    Assert.assertEquals(2, mrn.getCurrentNumeralValue(0));
    Assert.assertEquals(2, mrn.getCurrentNumeralValue(1));
    Assert.assertEquals(1, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(3));
    //
View Full Code Here

    Assert.assertEquals(1, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(3));
    //
    mrn = new MixedRadixNumber(0, new int[] { 3, 3, 2, 2 });
    mrn.setCurrentValueFor(new int[] { 2, 2, 0, 0 });
    Assert.assertEquals(8, mrn.intValue());
    Assert.assertEquals(2, mrn.getCurrentNumeralValue(0));
    Assert.assertEquals(2, mrn.getCurrentNumeralValue(1));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(3));
    //
View Full Code Here

    Assert.assertEquals(0, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(0, mrn.getCurrentNumeralValue(3));
    //
    mrn = new MixedRadixNumber(0, new int[] { 3, 4, 5, 6 });
    mrn.setCurrentValueFor(new int[] { 2, 3, 4, 5 });
    Assert.assertEquals(359, mrn.intValue());
    Assert.assertEquals(2, mrn.getCurrentNumeralValue(0));
    Assert.assertEquals(3, mrn.getCurrentNumeralValue(1));
    Assert.assertEquals(4, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(5, mrn.getCurrentNumeralValue(3));
    //
View Full Code Here

    Assert.assertEquals(4, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(5, mrn.getCurrentNumeralValue(3));
    //
    mrn = new MixedRadixNumber(0, new int[] { 6, 5, 4, 3 });
    mrn.setCurrentValueFor(new int[] { 5, 4, 3, 2 });
    Assert.assertEquals(359, mrn.intValue());
    Assert.assertEquals(5, mrn.getCurrentNumeralValue(0));
    Assert.assertEquals(4, mrn.getCurrentNumeralValue(1));
    Assert.assertEquals(3, mrn.getCurrentNumeralValue(2));
    Assert.assertEquals(2, mrn.getCurrentNumeralValue(3));
  }
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.