Examples of Wall


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

Examples of aima.core.environment.xyenv.Wall

  @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

Examples of aima.core.environment.xyenv.Wall

    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

Examples of aima.core.environment.xyenv.Wall

  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

Examples of com.echoeight.tankd.entity.Wall

        return delta;
    }
   
  public void drawLevel(){
    for(int i=55;i<HEIGHT;i+=20){
      walls.add(new Wall(em,10,i,20,20));
    }
    for(int i=45;i<HEIGHT;i+=20){
      walls.add(new Wall(em,WIDTH-10,i+10,20,20));
    }
    for(int i=0;i<WIDTH;i+=20){
      walls.add(new Wall(em,i,55,20,20));
    }
    for(int i=0;i<WIDTH;i+=20){
      walls.add(new Wall(em,i,HEIGHT-10,20,20));
    }
  }
View Full Code Here

Examples of com.eteks.sweethome3d.model.Wall

public class HomeFileRecorderTest extends TestCase {
  public void testWriteReadHome() throws RecorderException {
    // 1. Create an empty home
    Home home1 = new Home();
    // Add to home a wall and a piece of furniture
    Wall wall = new Wall(0, 10, 100, 80, 10);
    home1.addWall(wall);
    FurnitureCatalog catalog = new DefaultFurnitureCatalog();
    HomePieceOfFurniture piece = new HomePieceOfFurniture(
        catalog.getCategories().get(0).getFurniture().get(0));
    home1.addPieceOfFurniture(piece);
View Full Code Here

Examples of com.eteks.sweethome3d.model.Wall

          this.movedPieceOfFurniture.setDepth(this.depthMovedPieceOfFurniture);
        }
        this.movedPieceOfFurniture.setElevation(this.elevationMovedPieceOfFurniture);
        this.movedPieceOfFurniture.move(x - getXLastMousePress(), y - getYLastMousePress());
        if (this.magnetismEnabled) {
          Wall magnetWall = adjustPieceOfFurnitureOnWallAt(this.movedPieceOfFurniture, x, y);
          if (magnetWall != null) {
            getView().setDimensionLinesFeedback(
                getDimensionLinesAlongWall(this.movedPieceOfFurniture, magnetWall));
          } else {
            getView().setDimensionLinesFeedback(null);
View Full Code Here

Examples of com.eteks.sweethome3d.model.Wall

          this.draggedPieceOfFurniture.setDepth(this.depthDraggedPieceOfFurniture);
        }
        this.draggedPieceOfFurniture.setElevation(this.elevationDraggedPieceOfFurniture);
        this.draggedPieceOfFurniture.move(x, y);

        Wall magnetWall = adjustPieceOfFurnitureOnWallAt(this.draggedPieceOfFurniture, x, y);
        if (magnetWall != null) {
          getView().setDimensionLinesFeedback(
              getDimensionLinesAlongWall(this.draggedPieceOfFurniture, magnetWall));
        } else {
          getView().setDimensionLinesFeedback(null);
View Full Code Here

Examples of com.eteks.sweethome3d.model.Wall

    protected Integer getWallAngleInDegrees(Wall wall) {
      return getWallAngleInDegrees(wall, wall.getStartPointToEndPointDistance());
    }

    private Integer getWallAngleInDegrees(Wall wall, float startPointToEndPointDistance) {
      Wall wallAtStart = wall.getWallAtStart();
      if (wallAtStart != null) {
        float wallAtStartSegmentDistance = wallAtStart.getStartPointToEndPointDistance();
        if (startPointToEndPointDistance != 0 && wallAtStartSegmentDistance != 0) {
          // Compute the angle between the wall and its wall at start
          float xWallVector = (wall.getXEnd() - wall.getXStart()) / startPointToEndPointDistance;
          float yWallVector = (wall.getYEnd() - wall.getYStart()) / startPointToEndPointDistance;
          float xWallAtStartVector = (wallAtStart.getXEnd() - wallAtStart.getXStart()) / wallAtStartSegmentDistance;
          float yWallAtStartVector = (wallAtStart.getYEnd() - wallAtStart.getYStart()) / wallAtStartSegmentDistance;
          if (wallAtStart.getWallAtStart() == wall) {
            // Reverse wall at start direction
            xWallAtStartVector = -xWallAtStartVector;
            yWallAtStartVector = -yWallAtStartVector;
          }
          int wallAngle = (int)Math.round(180 - Math.toDegrees(Math.atan2(
View Full Code Here

Examples of com.eteks.sweethome3d.model.Wall

        } else {
          getView().setAngleFeedback(wall.getXArcCircleCenter(), wall.getYArcCircleCenter(),
              wall.getXEnd(), wall.getYEnd(), wall.getXStart(), wall.getYStart());
        }
      } else {
        Wall wallAtStart = wall.getWallAtStart();
        if (wallAtStart != null) {
          if (wallAtStart.getWallAtStart() == wall) {
            if (getWallAngleInDegrees(wall) > 0) {
              getView().setAngleFeedback(wall.getXStart(), wall.getYStart(),
                  wallAtStart.getXEnd(), wallAtStart.getYEnd(), wall.getXEnd(), wall.getYEnd());
            } else {
              getView().setAngleFeedback(wall.getXStart(), wall.getYStart(),
                  wall.getXEnd(), wall.getYEnd(), wallAtStart.getXEnd(), wallAtStart.getYEnd());
            }
          } else {
            if (getWallAngleInDegrees(wall) > 0) {
              getView().setAngleFeedback(wall.getXStart(), wall.getYStart(),
                  wallAtStart.getXStart(), wallAtStart.getYStart(),
                  wall.getXEnd(), wall.getYEnd());
            } else {
              getView().setAngleFeedback(wall.getXStart(), wall.getYStart(),
                  wall.getXEnd(), wall.getYEnd(),
                  wallAtStart.getXStart(), wallAtStart.getYStart());
            }
          }
        }
      }
    }
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.