Package aima.core.environment.xyenv

Examples of aima.core.environment.xyenv.Wall


    Assert.assertEquals(new XYLocation(3, 4), env.getCurrentLocationFor(a));
  }

  @Test
  public void testAddObject2() {
    env.addObjectToLocation(new Wall(), new XYLocation(9, 9));
    Assert.assertEquals(1, env.getAgents().size());
    Assert.assertEquals(2, env.getEnvironmentObjects().size());
    Assert.assertEquals(1, env.getObjectsAt(new XYLocation(9, 9)).size());
  }
View Full Code Here


  @Test
  public void testIsBlocked() {
    XYLocation loc = new XYLocation(5, 5);
    Assert.assertEquals(0, env.getObjectsAt(loc).size());
    Assert.assertEquals(false, env.isBlocked(loc));
    env.addObjectToLocation(new Wall(), loc);
    Assert.assertEquals(1, env.getObjectsAt(loc).size());
    Assert.assertEquals(true, env.isBlocked(loc));
  }
View Full Code Here

    env.moveObjectToAbsoluteLocation(a, loc);
    XYLocation northLoc = new XYLocation(5, 6);
    XYLocation southLoc = new XYLocation(5, 4);
    XYLocation westLoc = new XYLocation(4, 5);

    env.addObjectToLocation(new Wall(), northLoc); // wall to the north of
    // object
    Assert.assertTrue(env.isBlocked(northLoc));
    env.addObjectToLocation(new Wall(), southLoc); // wall to the south of
    // object
    env.addObjectToLocation(new Wall(), westLoc); // wall to the west of
    // object
    Assert.assertEquals(4, env.getEnvironmentObjects().size());

    env.moveObject(a, XYLocation.Direction.North); // should not move
    env.moveObject(a, XYLocation.Direction.South); // should not move
View Full Code Here

  public void testGetObjectsNear() {
    XYLocation loc = new XYLocation(5, 5);
    env.moveObjectToAbsoluteLocation(a, loc);
    AbstractAgent b = new MockAgent();
    AbstractAgent c = new MockAgent();
    Wall w1 = new Wall();

    env.addObjectToLocation(b, new XYLocation(7, 4));
    env.addObjectToLocation(c, new XYLocation(5, 7));
    env.addObjectToLocation(w1, new XYLocation(3, 10));
View Full Code Here

TOP

Related Classes of aima.core.environment.xyenv.Wall

Copyright © 2018 www.massapicom. 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.