hoi
[mc1516the.git] / second.tex
1 \emph{Rush Hour is a puzzle where on a $6\times6$ board trucks and cars are
2 placed in an initial position. The goal is to move the vehicles forward and
3 backward in such a way that the red car can leave the board at the exit on the
4 right. Here you see a picture: and here you find more information, including
5 the possibility to play online: \url{http://thinkfun.com/products/rush-hour/}}
6
7 \emph{Model the game in UPPAAL model and show how to find solutions. Make sure
8 you can solve at least the following positions:}
9
10 \subsection*{Model}
11
12 Our model can be found in \tt{2.xml} and traces for solving the intermediate
13 puzzle, the hard puzzle and the second puzzle from the provided website can be
14 found in \tt{2intermediateTrace.xtr, 2hardTrace.xtr} and
15 \tt{2website2Trace.xtr} respectively.
16
17 Our model is centered around a global state \tt{bool grid[6][6]} which tracks
18 for each square if part of a car is on it or not. There is a player which
19 starts the game and stops the game when the red car is at the exit. The player
20 starts the game if all cars have registered their presence on the grid.
21
22 Cars are modeled as either vertical or horizontal variants. Both behave exactly
23 the same, apart from the obvious difference that horizontal cars move along the
24 x-axis, while vertical cars move along the y-axis. From their start state cars
25 first register themselves on the grid and sync on a \tt{reg!}. The player
26 counts these \tt{reg}s and broadcasts \tt{start!} as all cars have registered.
27 Cars then non-deterministically move either up/right or down/left.
28
29 The red car is a special case of a horizontal car, which always runs on the
30 fourth row and syncs \tt{finish!} when it is at the exit.
31
32 \subsection*{Results}
33 Our model is quite fast in solving the provided puzzles. It can solve the
34 intermediate and hard puzzles from the exercise and the second puzzle from the
35 website, the first puzzle however can not be solved by our model.
36
37 \begin{tabular}{lrr}
38 \toprule
39 puzzle & time & memory\\
40 \midrule
41 intermediate & $\pm5$ seconds & $78$ mb\\
42 hard & $\pm0.1$ seconds & $50$ mb\\
43 website 1 & \multicolumn{2}{c}{Not solvable}\\
44 website 2 & $\pm0.2$ seconds & $50$ mb\\
45 \bottomrule
46 \end{tabular}
47
48 It might seem unexpected that the intermediate result runs (considerably)
49 slower than the two harder challenges. The exact reason for this is unknown to
50 us, however it might be because the intermediate challenge has considerably
51 more cars than the other two challenges (13 vs. 7 and 9). This means that the
52 state space of possible moves and possible car positions is much larger in the
53 the intermediate example. Since our model does not contain any heuristics, thus
54 cars move non-deterministically, the intermediate challenge has a lot more
55 possible moves.