Examples of CellWorldPosition


Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(3, pos.getY());
  }

  @Test
  public void testMoveUpActuallyMovesRightWhenProbabilityGreaterThan90Percent() {
    CellWorldPosition pos = cw.moveProbabilisticallyFrom(1, 3,
        CellWorld.UP, greaterThanNinetyPercent);
    Assert.assertEquals(1, pos.getX());
    Assert.assertEquals(4, pos.getY());
  }
View Full Code Here

Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(4, pos.getY());
  }

  @Test
  public void testMoveDownIntoWallLeavesPositionUnchanged() {
    CellWorldPosition pos = cw.moveProbabilisticallyFrom(1, 1,
        CellWorld.DOWN, alwaysLessThanEightyPercent);
    Assert.assertEquals(1, pos.getX());
    Assert.assertEquals(1, pos.getY());
  }
View Full Code Here

Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(1, pos.getY());
  }

  @Test
  public void testMoveDownIntoUnblockedCellChangesPositionCorrectly() {
    CellWorldPosition pos = cw.moveProbabilisticallyFrom(2, 1,
        CellWorld.DOWN, alwaysLessThanEightyPercent);
    Assert.assertEquals(1, pos.getX());
    Assert.assertEquals(1, pos.getY());
  }
View Full Code Here

Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(1, pos.getY());
  }

  @Test
  public void testMoveDownIntoBlockedCellLeavesPositionUnchanged() {
    CellWorldPosition pos = cw.moveProbabilisticallyFrom(3, 2,
        CellWorld.UP, alwaysLessThanEightyPercent);
    Assert.assertEquals(3, pos.getX());
    Assert.assertEquals(2, pos.getY());
  }
View Full Code Here

Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(2, pos.getY());
  }

  @Test
  public void testMoveDownActuallyMovesLeftWhenProbabilityBetween80And90Percent() {
    CellWorldPosition pos = cw.moveProbabilisticallyFrom(3, 3,
        CellWorld.DOWN, betweenEightyAndNinetyPercent);
    Assert.assertEquals(3, pos.getX());
    Assert.assertEquals(2, pos.getY());
  }
View Full Code Here

Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(2, pos.getY());
  }

  @Test
  public void testMoveDownActuallyMovesRightWhenProbabilityGreaterThan90Percent() {
    CellWorldPosition pos = cw.moveProbabilisticallyFrom(2, 3,
        CellWorld.UP, greaterThanNinetyPercent);
    Assert.assertEquals(2, pos.getX());
    Assert.assertEquals(4, pos.getY());
  }
View Full Code Here

Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(11, cw.unblockedCells().size());
  }

  @Test
  public void testMoveFromATerminalStateFailsForAllProbabilityValues() {
    CellWorldPosition pos = cw.moveProbabilisticallyFrom(2, 4,
        CellWorld.UP, alwaysLessThanEightyPercent);
    Assert.assertEquals(2, pos.getX());
    Assert.assertEquals(4, pos.getY());
  }
View Full Code Here

Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(4, pos.getY());
  }

  @Test
  public void testTransitionProbabilityCalculationWhenEndingPositionIsNextToStartingPositionButIsBlocked() {
    CellWorldPosition startingPosition = new CellWorldPosition(2, 1);
    // to the left of blocked cell
    CellWorldPosition endingPosition = new CellWorldPosition(2, 2); // blocked
    // cell
    double transitionProb = cw.getTransitionProbability(startingPosition,
        CellWorld.RIGHT, endingPosition);
    Assert.assertEquals(0.0, transitionProb, 0.001);
  }
View Full Code Here

Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(0.0, transitionProb, 0.001);
  }

  @Test
  public void testTransitionProbabilityCalculationWhenEndingPositionCannotBeReachedUsingDesiredActionOrRightAngledSteps() {
    CellWorldPosition startingPosition = new CellWorldPosition(1, 3);
    CellWorldPosition endingPosition = new CellWorldPosition(3, 3);
    double transitionProb = cw.getTransitionProbability(startingPosition,
        CellWorld.UP, endingPosition);
    Assert.assertEquals(0.0, transitionProb, 0.001);
  }
View Full Code Here

Examples of aima.core.environment.cellworld.CellWorldPosition

    Assert.assertEquals(0.0, transitionProb, 0.001);
  }

  @Test
  public void testTransitionProbabilityCalculationWhenEndingPositionReachebleByExecutingSuggestedAction() {
    CellWorldPosition startingPosition = new CellWorldPosition(1, 1);
    CellWorldPosition endingPosition = new CellWorldPosition(2, 1);
    double transitionProb = cw.getTransitionProbability(startingPosition,
        CellWorld.UP, endingPosition);
    Assert.assertEquals(0.8, transitionProb, 0.001);
  }
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.