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