From: Mart Lubbers Date: Mon, 17 Nov 2014 15:56:40 +0000 (+0100) Subject: mooie boom gemaakt en jou lelijke boom weggehaald X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=5c7f7cbc04d8d4f76d9370927c287f4a0e390413;p=ker1415-1.git mooie boom gemaakt en jou lelijke boom weggehaald --- diff --git a/report/Makefile b/report/Makefile index 7e10403..7b14a86 100644 --- a/report/Makefile +++ b/report/Makefile @@ -3,4 +3,4 @@ all: pdflatex -shell-escape report.tex clean: - rm -vf *.aux *.log *.pdf *.toc *.pyg + rm -vf *.aux *.log *.pdf *.toc *.pyg *.out diff --git a/report/ass2.tex b/report/ass2.tex index 32f6adf..c0860d1 100644 --- a/report/ass2.tex +++ b/report/ass2.tex @@ -5,20 +5,85 @@ \prologcode{./src/task12.pl} \end{listing} - \subsubsection{Task 13: Define your data structure} \begin{listing}[H] \caption{Hitting set datastructure} \prologcode{./src/hs.pl} \end{listing} -Our datastructure uses the predicate node to signify nodes and leaf for leaves. A node contains a list of edge labels and another list (with the same length as the amound of edge labels) that contains nodes or leaves. The edge label corresponds with its order in the list it is in. -Examples: -node([a,b],[leaf,leaf]) -node([a,b], [node([c,d], [leaf,leaf]), node([e,f], [leaf,leaf])]) -node([a,b], [node([c,d], [node([g,h,i], [leaf,leaf,leaf]),leaf]), node([a,f], [leaf,leaf])]) -%insert hittingsettrees.png + +\tikzstyle{level 1}=[level distance=1cm, sibling distance=1cm] +\tikzstyle{level 2}=[level distance=1cm, sibling distance=1cm] +\tikzstyle{bag} = [text width=4em, text centered] +\tikzstyle{end} = [minimum width=3pt, inner sep=0pt] +\begin{figure}[H] + \caption{Examples of good hitting set trees} + \begin{tikzpicture} [grow=down] + \node[bag] {\{$a, b\}$} + child { + node[end, label=below:$\checkmark$]{} + edge from parent + node[left] {$a$} + } + child { + node[end, label=below:$\checkmark$]{} + edge from parent + node[right] {$b$} + }; + \end{tikzpicture} + \begin{tikzpicture} [grow=down] + \node[bag] {\{$a, b\}$} + child { + node[bag] {$\{c, d\}$} + child { + node[end, label=below:$\checkmark$]{} + edge from parent + node[left] {$c$} + } + child { + node[end, label=below:$\checkmark$]{} + edge from parent + node[left] {$d$} + } + edge from parent + node[left] {$a$} + } + child { + node[end, label=below:$\checkmark$]{} + edge from parent + node[right] {$b$} + }; + \end{tikzpicture} +\end{figure} + +\begin{figure}[H] + \caption{Examples of bad hitting set trees due to duplicate edge labels} + \begin{tikzpicture} [grow=down] + \node[bag] {\{$a, b\}$} + child { + node[bag] {$\{c, a\}$} + child { + node[end, label=below:$\checkmark$]{} + edge from parent + node[left] {$c$} + } + child { + node[end, label=below:$\checkmark$]{} + edge from parent + node[left] {$a$} + } + edge from parent + node[left] {$a$} + } + child { + node[end, label=below:$\checkmark$]{} + edge from parent + node[right] {$b$} + }; + \end{tikzpicture} +\end{figure} + \subsubsection{Task 14: Implementation} \begin{listing}[H] \caption{Code for generating a hitting set tree} \prologcode{./src/task14.pl} -\end{listing} \ No newline at end of file +\end{listing} diff --git a/report/report.out b/report/report.out deleted file mode 100644 index 7a7ad16..0000000 --- a/report/report.out +++ /dev/null @@ -1,19 +0,0 @@ -\BOOKMARK [1][-]{section.1}{Assignment 1-1}{} -\BOOKMARK [2][-]{subsection.1.1}{Part 1: Modelling Sokoban}{section.1} -\BOOKMARK [3][-]{subsubsection.1.1.1}{Task 1: Knowledge base}{subsection.1.1} -\BOOKMARK [3][-]{subsubsection.1.1.2}{Task 2: Actions}{subsection.1.1} -\BOOKMARK [2][-]{subsection.1.2}{Part 2: Implementation}{section.1} -\BOOKMARK [3][-]{subsubsection.1.2.1}{Task 3: Translate Axioms}{subsection.1.2} -\BOOKMARK [3][-]{subsubsection.1.2.2}{Task 4: The Planning Problem in Figure 1}{subsection.1.2} -\BOOKMARK [3][-]{subsubsection.1.2.3}{Task 5: Crates go to Any Goal Location}{subsection.1.2} -\BOOKMARK [3][-]{subsubsection.1.2.4}{Task 6: Inverse Problem}{subsection.1.2} -\BOOKMARK [2][-]{subsection.1.3}{Part 3: Extending the domain}{section.1} -\BOOKMARK [3][-]{subsubsection.1.3.1}{Task 7: Unlocking the Crates}{subsection.1.3} -\BOOKMARK [2][-]{subsection.1.4}{Part 4: General questions}{section.1} -\BOOKMARK [3][-]{subsubsection.1.4.1}{Task 10: Sitcalc expressivity}{subsection.1.4} -\BOOKMARK [3][-]{subsubsection.1.4.2}{Task 11: Related work}{subsection.1.4} -\BOOKMARK [1][-]{section.2}{Assignment 1-2}{} -\BOOKMARK [2][-]{subsection.2.1}{Implementation of the hitting-set algorithm}{section.2} -\BOOKMARK [3][-]{subsubsection.2.1.1}{Task 12: Generate conflict}{subsection.2.1} -\BOOKMARK [3][-]{subsubsection.2.1.2}{Task 13: Define your data structure}{subsection.2.1} -\BOOKMARK [3][-]{subsubsection.2.1.3}{Task 14: Implementation}{subsection.2.1} diff --git a/report/report.tex b/report/report.tex index 42bf2c6..c76e467 100644 --- a/report/report.tex +++ b/report/report.tex @@ -7,9 +7,12 @@ \usepackage{amsmath} \usepackage{amssymb} \usepackage{minted} -\usepackage{hyperref} +\usepackage[hidelinks]{hyperref} +\usepackage{tikz} -\author{\small Mart Lubbers\and Caspar Safarlou} +\usetikzlibrary{trees} + +\author{Mart Lubbers\and Caspar Safarlou} \title{Knowledge Representation and Reasoning.\\Assignment 1} \date{\today} diff --git a/report/src/hittingsettrees.png b/report/src/hittingsettrees.png deleted file mode 100644 index 12c76b6..0000000 Binary files a/report/src/hittingsettrees.png and /dev/null differ