[Solved] SOLVED:EECS 397 Software Craftsmanship Programming Assignment 2

$25

File Name: SOLVED:EECS_397_Software_Craftsmanship_Programming_Assignment_2.zip
File Size: 593.46 KB

SKU: [Solved] SOLVED:EECS 397 Software Craftsmanship Programming Assignment 2 Category: Tag:
5/5 - (1 vote)

Programming A lab mouse is being trained to escape from a maze. The maze is made up of cells, and each cell is connected to some other cells. However, there are obstacles in the passage between two cells and therefore (i) it takes some time to go through the passage, and (ii) the passages only allow the mouse the go one way, but not the other way around. First, as a general rule, if a passage has a passage time equal to Integer.MAX_VALUE, then in practice the passage is unusable and the mouse will not be able to cross it to reach another cell. The class MazeCell represents a cell in the maze and its passages to adjoining cells. The cell is marked as invalid when it is first constructed, and it turns to a valid cell once it is connected to other cells. MazeCell implements the following methods: MazeCell() sets up an invalid MazeCell. The constructor must not throw any exception. boolean addPassages(Map<MazeCell, Integer passages) sets up the outgoing passages from this MazeCell, and makes this MazeCell valid. The argument gives the travel time along a passage from this MazeCell to another MazeCell in seconds. There can be only one passage between one cell and another one. A travel time equal to MAX_VALUE represents an impassable connection. The travel time can be zero or negative (this will be fixed in future assignments). If this MazeCell had already been connected with some passages (that is, this MazeCell was already valid), the method does nothing and returns false, otherwise it returns true. boolean isValid() returns whether this MazeCell is valid. int hashCode() returns a hash code for this MazeCell. Page 2 of 3 Map<MazeCell, Integer passages() returns the passages from this MazeCell, which must comprise all other MazeCells whose travel time is less than MAX_VALUE. You should take steps so that the returned map cannot be abused to change the connections from this MazeCell. The method throws a UninitializedObjectException (see later) if this MazeCell is invalid. Integer passageTimeTo(MazeCell cell) gives the times to cross from this cell to the given cell by traversing a single passage. If there is no direct passage, passageTimeTo returns MAX_VALUE. The method throws a UninitializedObjectException if this MazeCell is invalid. Set

Shopping Cart
[Solved] SOLVED:EECS 397 Software Craftsmanship Programming Assignment 2
$25