Commit 5d226d8c authored by Jaime Arias's avatar Jaime Arias
Browse files

add tricky ADTree model

parent 5629a7ce
\documentclass[preview]{standalone}
\input{../../base.tex}
\begin{document}
\begin{figure}
\begin{minipage}[c]{0.5\textwidth}%
% ADT
\centering
\scalebox{.75}{
\begin{tikzpicture}[every node/.style={ultra thick,draw=red}]
% depth 0
\node[and gate US,point up,logic gate inputs=nn] (A) {\rotatebox{-90}{$A$}};
% depth 1
\node[and gate US,point up,logic gate inputs=nn,
below = 9mm of A.west, yshift=20mm] (B) {\rotatebox{-90}{$B$}};
\draw (B.east) -- ([yshift=0.15cm]B.east) -| (A.input 1);
\node[and gate US,point up,logic gate inputs=nn,
below = 9mm of A.west, yshift=-14mm] (C) {\rotatebox{-90}{$C$}};
\draw (C.east) -- ([yshift=0.15cm]C.east) -| (A.input 2);
% depth 2
\node[state, below = 3.6mm of B.west, xshift=-9mm] (d) {$d$};
\draw (d.north) -- ([yshift=0.15cm]d.north) -| (B.input 1);
\node[state, below = 3.6mm of B.west, xshift=9mm] (e) {$e$};
\draw (e.north) -- ([yshift=0.15cm]e.north) -| (B.input 2);
\node[state, below = 3.6mm of C.west, xshift=-9mm] (f) {$f$};
\draw (f.north) -- ([yshift=0.15cm]f.north) -| (C.input 1);
\node[state, below = 3.6mm of C.west, xshift=9mm] (g) {$g$};
\draw (g.north) -- ([yshift=0.15cm]g.north) -| (C.input 2);
\end{tikzpicture}
}
\end{minipage}
\begin{minipage}[c]{0.5\textwidth}%
\centering
% information
\scalebox{.75}{\parbox{\linewidth}{%
\begin{tabular}{l@{~}l@{~}r@{~}}
\textbf{Name} & \textbf{Cost} & \textbf{Time} \\
\hline
\gate{a} & \EUR{0} & 0~d \\
\gate{b} & \EUR{0} & 1~d \\
\gate{c} & \EUR{0} & 1~d \\
\leaf{d} & \EUR{0} & 1~d \\
\leaf{e} & \EUR{0} & 3~d \\
\leaf{f} & \EUR{0} & 1~d \\
\leaf{g} & \EUR{0} & 1~d \\
\end{tabular}
}}
\end{minipage}
\end{figure}
\end{document}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment