Package BasicDataType

Examples of BasicDataType.Map$Square


   
    fail("Not yet implemented");
  }

  public void testGetNext() {
    Map map = new Map((byte)10);
    Position currentPos = new Position();
    currentPos.setPosition(new Vector(5,5),0);
    //Position destinationPos = new Position(new Vector(2,0),0);
//    for(int y=1; y < 4; y++){
//      map.propagateOccupied((byte)1, (byte)y);
//    }
//    for(int y=1; y < 5; y++){
//      map.propagateEmpty((byte)0, (byte)y);
//    }
//    for(int x=1; x < 3; x++){
//      map.propagateEmpty((byte)x, (byte)0);
//    }
    Rect bound = new Rect(5, 6, 6,5);
    Search search = new Search(map);   
    for(int i = 0; i < 5 ; i++) {
      currentPos = search.getNext(currentPos, map, bound);
      if (currentPos == null) {
        bound.setRect(0, 9, 9, 0);
        currentPos = new Position(new Vector(5,5), 3);
        for(int j = 0; j < 5 ; j++) {
          currentPos = search.getNext(currentPos, map, bound);
          map.propagateEmpty((byte)currentPos.pos.x,(byte)currentPos.pos.y);
          map.showMap();
          System.out.println();
        }
        return;
      }
      map.propagateEmpty((byte)currentPos.pos.x,(byte)currentPos.pos.y);
      map.showMap();
      System.out.println();
    }

   
    //map.showMap();
View Full Code Here


    //System.out.println(search.getNext(currentPos, map, bound).pos.y);
    //map.getVisitedSquares();
  }
 
  public void testClosestPath() {
    Map map = new Map((byte)5);
    Position currentPos = new Position(new Vector(0,0),0);
    Position destinationPos = new Position(new Vector(2,0),0);
    for(int y=0; y < 3; y++){
      map.propagateOccupied((byte)1, (byte)y);
    }
    Position nextPosition = new Position();
    Search search = new Search(map);
    //search.closestPath(map, currentPos, destinationPos,nextPosition);
    //map.showMap();
View Full Code Here

    //assertTrue(search.closestPath(map, currentPos, destinationPos, nextPosition) == 16);
   
  }
 
  public void testCheckZero() {
    Map map = new Map((byte)5);
//    Position curPosition = new Position(new Vector(0,0),0);
//    Position pos = new Position(new Vector(1,1),0);
//    int step = 3;
//    int min = Integer.MAX_VALUE;
//    Rect bound = new Rect(0,0,4,4);
View Full Code Here

//    Search search = new Search(map);
    //search.checkZero(map, pos, curPosition, step, min, bound, minPos);
  }
 
  public void testAllSearched() {
    Map map = new Map((byte)5);
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        map.propagateOccupied((byte)i, (byte)j);
      }
    }
    //map.showMap();
    Rect bound = new Rect(0,0,3,3);
    Search search = new Search(map);
View Full Code Here

TOP

Related Classes of BasicDataType.Map$Square

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.