Contents Trains Vending Minesweeper |
Trains The figure below shows a simple train network.
A single engine, which we can refer to as e, travels back and forth from station a to station b. At station a there are three ports, p1, p2, and p3, where the train can pick up or discharge cars. There are another three ports, p4, p5, and p6, at station b. Informally, there are three kinds of actions available in this train domain. The first part of this problem is to formalize these actions in the STRIPS action representation -- indicating what the preconditions of each action are, what relationships the action disrups (which go on a delete list for the action), and what relationships the action establishes (which go on an add list for the action). The actions are:
Consider the following situation. The engine, with no cars attached, is located at station a. All of the ports are empty, except p4, which contains car c1 which is loaded with a tank of orange juice. We want to get c1 into port p1 where the orange juice can be bottled and distributed to local stores.
Now we consider a more complicated situation. We still want to get the tank of orange juice from p4 to p1, but now things start off like this. The engine is at station b, and, as before, car c1 is at p4 and ports p5 and p6 are empty. However, there is a car at each of the ports at station a: p1 has c2 p2 has c3 and p3 has c4.
Many campus buildings at Rutgers are stocked with a certain kind of vending machine that dispenses candy and other snacks. You put some money in it, and then enter two digits that indicate what your selection was. A screw at the coordinates you've specified turns to release the food you have selected, while at the same time any change for your purchase is rung out for you. This problem looks at formalizing and analyzing a simplified version of this behavior, using the situation calculus. Our first idealization is a generous one - we abstract away from the fact that this machine actually requires money to operate and just assume that it gives out candy whenever you make a selection into it. The second idealization is to narrow down the buttons to a single set of four buttons that you can use to specify both coordinates of a selection. These buttons will be called a, b, c and d - and we can use these to go proxy for the actions of pressing these buttons.
Minesweeper is a common single-player computer game. It's played on a grid; cells on the grid are initially concealed and may be explored by clicking on them. Some of the cells hide bombs; clicking on them loses you the game. Fortunately, when you explore a cell with no bombs - a clear cell - you learn information about the cells nearby. Each exposed clear cell gets labeled with the number of bombs located in the adjacent cells (e.g., the eight neighboring cells for a cell in the middle of the board). For example, we can use @ to represent a bomb and ^ to represent a clear cell; suppose the grid actually contains clear cells and bombs as follows:
Then clicking on the center square will reveal the number three, indicating that three of the eight adjacent squares actually contain bombs. Here is a more complicated board, with ?'s in the unexplored cells to give you the view of the board as a minesweeper player might actually see it:
(Treat the board as complete, so that tallies for cells on the boundary only report the three or five adjacent cells that are represented in the board diagram.) You can formulate a constraint satisfaction problem to figure out where there must be bombs (and where there may or may not be bombs) according to these counts.
Here is a board that looks simpler but requires more complicated reasoning than the board we just treated.
|