public void setInitialTile(LocalVacuumEnvironmentPerceptTaskEnvironmentB vep) { boolean dirty = (vep.getState().getLocState() == LocationState.Clean) ? false : true; Tile t = new Tile(new Point(0, 0), false, false, dirty, vep.isOnBase()); rows = vep.getN(); cols = vep.getM(); this.setTile(t); currentPosition = t; if (vep.isOnBase()) this.setBase(t); for (Point p : getAdjWalkablePoints(getCurrentPositionPoint())) unexploredPoints.add(p); }
public void updateMap(LocalVacuumEnvironmentPerceptTaskEnvironmentB vep, Movement lastAction) { /* we don't move in the last step */ if (lastAction == null) return; Point p = MapUtils.neighbourFromDirection(getCurrentPositionPoint(), lastAction); /* we hit an obstacle */ if (!vep.isMovedLastTime()) { Tile t = new Tile( p, false, /* we need it?? TODO */ true, /* is an obstacles */ false, /* wall never dirty */ false); /* wall never base */ // , this.setTile(t); updateUnexploredPointListNoMove(); } else { // We moved Tile t = new Tile( p, false, /* we need it?? TODO */ false, /* is no an obstacles */ (vep.getState().getLocState() == LocationState.Dirty), vep.isOnBase()); this.setTile(t); if (vep.isOnBase()) setBase(t); this.currentPosition = t; updateUnexploredPointList(); } // System.out.println(getCurrentPosition().getPoint()); if (!colsWallsDetected || !rowsWallsDetected) checkWalls(); }