update
[mc1516pa.git] / report2 / implementation.tex
index b8011a4..ef4c574 100644 (file)
@@ -1,7 +1,9 @@
 \section{Implementation}
 \subsection{Screen encoding}
 When parsed the sokoban screen is stripped of all walls and unreachable empty
-spaces are removed.
+spaces are removed. Moreover, a screen is rejected if either there are no
+boxes, there is no agent or the number of boxes is not equal to the number of
+targets.
 
 Let $T=\{free,box,target,agent,targetagent,targetbox\}$ be the set of possible
 states of a tile. Tiles are numbered and thus a sokoban screen is the set $F$
@@ -69,14 +71,17 @@ $$next(i_1, i_2, i_3)=\left\{\begin{array}{lll}
        (targetagent, i_2, i_3) & \text{if } & i_1=targetagent\\
 \end{array}\right.$$
 
+\subsection{Goal encoding}
+Encoding the goal state is very trivial. Just make sure all $target$ tiles are
+$targetbox$ tiles.
+
 \subsection{Example}
-For example, take the toy screen shown in Listing~\ref{lst:toy}. When the
-screen is parsed the unreachable space is first removed by detecting reachable
-space with the flood fill algorithm. This results in the minimized screen
-listed in Listing~\ref{lst:toy2}.
+For example, take the toy screen shown as the first representation in
+Listing~\ref{lst:toy}. When the screen is parsed the unreachable space is first
+removed by detecting reachable space with the flood fill algorithm. This
+results in the second representation in Listing~\ref{lst:toy}.
 
 \lstinputlisting[label={lst:toy},caption={Example screen}]{toy.screen}
-\lstinputlisting[label={lst:toy2},caption={Example screen}]{toy2.screen}
 
 \subsubsection{Encoding}
 To encode the screen the tiles are numbered from left to right from top to