From 6a1c7122203eb3f073405cafd63cb1e13e9956b9 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Thu, 21 Apr 2016 17:13:04 +0200 Subject: [PATCH] update --- report2/implementation.tex | 17 +++++++++++------ report2/toy.screen | 2 +- report2/toy2.screen | 1 - 3 files changed, 12 insertions(+), 8 deletions(-) delete mode 100644 report2/toy2.screen diff --git a/report2/implementation.tex b/report2/implementation.tex index b8011a4..ef4c574 100644 --- a/report2/implementation.tex +++ b/report2/implementation.tex @@ -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 diff --git a/report2/toy.screen b/report2/toy.screen index e02031d..a3e9b2d 100644 --- a/report2/toy.screen +++ b/report2/toy.screen @@ -1,3 +1,3 @@ - ### + ### @$. #@$.# ### diff --git a/report2/toy2.screen b/report2/toy2.screen deleted file mode 100644 index 8d4f16e..0000000 --- a/report2/toy2.screen +++ /dev/null @@ -1 +0,0 @@ -@$. -- 2.20.1