update
authorMart Lubbers <mart@martlubbers.net>
Thu, 21 Apr 2016 15:13:04 +0000 (17:13 +0200)
committerMart Lubbers <mart@martlubbers.net>
Thu, 21 Apr 2016 15:13:04 +0000 (17:13 +0200)
report2/implementation.tex
report2/toy.screen
report2/toy2.screen [deleted file]

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
index e02031d..a3e9b2d 100644 (file)
@@ -1,3 +1,3 @@
- ###
+ ###                @$.
 #@$.#
  ### 
diff --git a/report2/toy2.screen b/report2/toy2.screen
deleted file mode 100644 (file)
index 8d4f16e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@$.