// every cell knows to what cells it is connected // and ist's distance to door( initially -1) class Cell /*****************************************************************/ { ArrayList neighbourCells; float distanceToDoor = -1; float normalizedDistanceToDoor; Cell() /********constructor***********************************/ { neighbourCells = new ArrayList(); } /********Methods************************************************************** void addNeighbour(Cell cell) boolean isInList(ArrayList cells) ArrayList getNeighbours() void setDistanceToDoor(float distance) void setNormalizedDistanceToDoor(float maxDistance) float getDistanceToDoor() float getNormalizedDistanceToDoor() */ void addNeighbour(Cell cell) { neighbourCells.add(cell); } boolean isInList(ArrayList cells) { if (cells.contains(this)) return true; return false; } ArrayList getNeighbours() { return neighbourCells; } void setDistanceToDoor(float distance) { this.distanceToDoor = distance; } void setNormalizedDistanceToDoor(float maxDistance) { this.normalizedDistanceToDoor =(maxDistance-distanceToDoor); } float getDistanceToDoor() { return this.distanceToDoor; } float getNormalizedDistanceToDoor() { return this.normalizedDistanceToDoor; } }