From c4cb51a778a48f12c8389c8014763c804d1b1f16 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 18 Nov 2014 12:25:26 +0100 Subject: [PATCH] updated version very nice appendix jizz --- report/Makefile | 4 ++- report/additions.tex | 18 ++++++++++ report/appendix.tex | 35 +++++++++++++++++++ report/ass1.tex | 68 +++++++++++++++++++++---------------- report/ass2.tex | 2 +- report/report.tex | 6 ++++ report/src/instancetask4.pl | 2 -- report/src/instancetask5.pl | 6 ---- report/src/instancetask6.pl | 2 -- 9 files changed, 101 insertions(+), 42 deletions(-) create mode 100644 report/additions.tex create mode 100644 report/appendix.tex diff --git a/report/Makefile b/report/Makefile index 7b14a86..626797a 100644 --- a/report/Makefile +++ b/report/Makefile @@ -1,6 +1,8 @@ +SHELL:=/bin/bash + all: pdflatex -shell-escape report.tex pdflatex -shell-escape report.tex clean: - rm -vf *.aux *.log *.pdf *.toc *.pyg *.out + rm -vf *.{aux,log,pdf,toc,pyg,out} diff --git a/report/additions.tex b/report/additions.tex new file mode 100644 index 0000000..f61b39a --- /dev/null +++ b/report/additions.tex @@ -0,0 +1,18 @@ +\newpage +\subsection{Assignment 1-1} +Assignment 1 took us the entire running of the assignment minus one week. The +assignments setup told us to first make the situation calculus and then +implement it. However our first attempt for the situation calculus wasn't +correct so we had to rewrite that entire section after hacking in prolog to make +it work. + +\subsection{Assignment 1-2} +Assignment 2 took us a week, it was much more difficult our knowledge of prolog +was increased significantly so we weren't stopped by trivial prolog problems and +could work on it much more efficiently. + +\subsection{General remarks} +In our opinion the amount of information provided about the hittingset +algorithm and situation calculus is out of proportion concidering the very +important part it plays. For example situation calculus barely gets one page in +the reader and hitting set is also very sparsely described. diff --git a/report/appendix.tex b/report/appendix.tex new file mode 100644 index 0000000..af3d429 --- /dev/null +++ b/report/appendix.tex @@ -0,0 +1,35 @@ +\begin{listing}[H] + \caption{Domain description task 1} + \label{domaintasktask1} + \prologcode{./src/domaintask1.pl} +\end{listing} +\begin{listing}[H] + \caption{Instance description task 4} + \label{instancetask4} + \prologcode{./src/instancetask4.pl} +\end{listing} +\begin{listing}[H] + \caption{Instance description task 5} + \label{instancetask5} + \prologcode{./src/instancetask5.pl} +\end{listing} +\begin{listing}[H] + \caption{Instance description task 6} + \label{instancetask6} + \prologcode{./src/instancetask6.pl} +\end{listing} +\begin{listing}[H] + \caption{Domain description task 6} + \label{domaintask6} + \prologcode{./src/domaintask6.pl} +\end{listing} +\begin{listing}[H] + \caption{Instance description task 7} + \label{instancetask7} + \prologcode{./src/instancetask7.pl} +\end{listing} +\begin{listing}[H] + \caption{Domain description task 7} + \label{domaintask7} + \prologcode{./src/domaintask7.pl} +\end{listing} diff --git a/report/ass1.tex b/report/ass1.tex index 4e4c132..0e4034e 100644 --- a/report/ass1.tex +++ b/report/ass1.tex @@ -110,46 +110,54 @@ \newpage \subsection{Part 2: Implementation} \subsubsection{Task 3: Translate Axioms} -The only optimization added to the file is the reverse move optimization, -disallowing the agent to reverse a move immediatly. -\begin{listing}[H] - \caption{Domain description task 1} - \prologcode{./src/domaintask1.pl} -\end{listing} +The domain description can be found in \textit{./src/domaintask1.pl} and in +Listing~\ref{domaintask1} and is a literal translation from logics to prolog +code except for the visited predicate. The visited predicate disallows the +agent to reverse it's previous move immediatly. This makes the planning much +faster because it can cut of a lot of branches. \subsubsection{Task 4: The Planning Problem in Figure 1} -\begin{listing}[H] - \caption{Instance description task 4} - \prologcode{./src/instancetask4.pl} -\end{listing} +The instance description for this task can be found in +\textit{./src/instancetask4.pl} and in Listing~\ref{instancetask4}. This is a +literal translation of the description in logics. The goal location for the +crates are hardcoded to increase the performance. \subsubsection{Task 5: Crates go to Any Goal Location} -\begin{listing}[H] - \caption{Instance description task 5} - \prologcode{./src/instancetask5.pl} -\end{listing} +The instance description for this task can be found in +\textit{./src/instancetask5.pl} and in Listing~\ref{instancetask5}. This is an +adaptation of Listing~\ref{instancetask4} in the sense that in the goal state +the same goal locations for the crates apply but the crate instance does not +matter any more. Any combination of crates on the locations will be a valid +goal. \subsubsection{Task 6: Inverse Problem} -\begin{listing}[H] - \caption{Instance description task 6} - \prologcode{./src/instancetask6.pl} -\end{listing} -\begin{listing}[H] - \caption{Domain description task 6} - \prologcode{./src/domaintask6.pl} -\end{listing} +For tackling the inverse problem we have added a visited predicate that +describes if the agent has visited that particular location. In the instance +description found in \textit{./src/instancetask6.pl} or in +Listing~\ref{instancetask6} we made sure to mark the starting location for the +agent as visited because the agent does not have to revisit the starting +location. The goal is a simple forall that will only satisfy if for all +locations known the visited fluent is true. To generate all locations we used +the fact that all locations are connected to some other location. This could be +implemented more efficiently because in the current situation the locations +sequence contains a lot of duplicate locations. We reused the domain +description from task 4 with the visited fluent and adapted it slightly so that +it is never unset and therefore records all locations the agent has been. The +full ode can be found in \textit{./src/domaintask6.pl} or in +Listing~\ref{domaintask6}. \newpage \subsection{Part 3: Extending the domain} \subsubsection{Task 7: Unlocking the Crates} -\begin{listing}[H] - \caption{Instance description task 7} - \prologcode{./src/instancetask7.pl} -\end{listing} -\begin{listing}[H] - \caption{Domain description task 7} - \prologcode{./src/domaintask7.pl} -\end{listing} +For adding keys we have added in the instance definition, found in +\textit{./src/instancetask7.pl} or Listing~\ref{instancetask7}, new key fluents +that define were the keys are found. We also changed the crate fluent to arity +$4$ so that it also has a key attached to it. In the domain specification, +found in \textit{./src/domaintask7.pl} or Listing~\ref{domaintask7}, we added a +pickup move that allows the agent to pickup a certain key. When the agent picks +up a key the keyinbag fluent is then set so that the possibility function for +the push action can incorporate the fact that a key has to be picked up to push +a certain crate. \newpage \subsection{Part 4: General questions} diff --git a/report/ass2.tex b/report/ass2.tex index a158e77..0533a62 100644 --- a/report/ass2.tex +++ b/report/ass2.tex @@ -87,4 +87,4 @@ \begin{listing}[H] \caption{Code for generating a minimal hitting sets} \prologcode{./src/task14part2.pl} -\end{listing} \ No newline at end of file +\end{listing} diff --git a/report/report.tex b/report/report.tex index 7f6f722..824a48b 100644 --- a/report/report.tex +++ b/report/report.tex @@ -64,4 +64,10 @@ \section{Assignment 1-2} \input{ass2.tex} +\section{Additions} +\input{additions.tex} + +\section{Appendices} +\input{appendix.tex} + \end{document} diff --git a/report/src/instancetask4.pl b/report/src/instancetask4.pl index 8412e52..9bb77fb 100644 --- a/report/src/instancetask4.pl +++ b/report/src/instancetask4.pl @@ -3,7 +3,6 @@ :- [domaintask4]. % --- Definition of the initial state --------------------------------- -% north and east connected(loc11, loc21, east). connected(loc11, loc12, north). connected(loc12, loc22, east). @@ -22,7 +21,6 @@ connected(loc23, loc24, north). connected(loc31, loc32, north). connected(loc32, loc33, north). -% The other way around, west and south connected(loc21, loc11, west). connected(loc12, loc11, south). connected(loc22, loc12, west). diff --git a/report/src/instancetask5.pl b/report/src/instancetask5.pl index e602ef7..ca63832 100644 --- a/report/src/instancetask5.pl +++ b/report/src/instancetask5.pl @@ -3,7 +3,6 @@ :- [domaintask5]. % --- Definition of the initial state --------------------------------- -% north and east connected(loc11, loc21, east). connected(loc11, loc12, north). connected(loc12, loc22, east). @@ -22,7 +21,6 @@ connected(loc23, loc24, north). connected(loc31, loc32, north). connected(loc32, loc33, north). -% The other way around, west and south connected(loc21, loc11, west). connected(loc12, loc11, south). connected(loc22, loc12, west). @@ -45,10 +43,6 @@ crate(cratec, loc21, s0). crate(crateb, loc22, s0). crate(cratea, loc23, s0). -target(loc12). -target(loc13). -target(loc11). - agent(loc32, s0). % --- Goal condition that the planner will try to reach --------------- diff --git a/report/src/instancetask6.pl b/report/src/instancetask6.pl index 713d81d..f77f42d 100644 --- a/report/src/instancetask6.pl +++ b/report/src/instancetask6.pl @@ -3,7 +3,6 @@ :- [domaintask6]. % --- Definition of the initial state --------------------------------- -% north and east connected(loc11, loc21, east). connected(loc11, loc12, north). connected(loc12, loc22, east). @@ -22,7 +21,6 @@ connected(loc23, loc24, north). connected(loc31, loc32, north). connected(loc32, loc33, north). -% The other way around, west and south connected(loc21, loc11, west). connected(loc12, loc11, south). connected(loc22, loc12, west). -- 2.20.1