Debian Codegraph @

doc/citp-manual/apply-order.tikz.tex

raw
1 \begin{tikzpicture}[>=latex']
2 \tikzstyle{goal} = [draw, rectangle, minimum width=1.9cm, minimum height=3em, thick, rounded corners=1mm]
3 \def\deltay{1.8}
4 \def\deltax{2.4}
5 \definecolor{t1c}{RGB}{4,141,159}
6 \definecolor{t2c}{RGB}{158,141,44}
7 \definecolor{t3c}{RGB}{170,94,51}
8
9 \node (root) at (11,11.5) {} ;
10 \node (n) at (10,10) [goal] {n};
11 \node (n-dots) at (10.3, 10-\deltay) [goal] {\ldots};
12 \node (n-2) at (10.3-\deltax, 10-\deltay) [goal] {n-2};
13 \node (n-1) at (10.3-2*\deltax, 10-\deltay) [goal] {n-1};
14 %
15 \node (n-2-dots) at (10.3, 10-2*\deltay) [goal] {\ldots};
16 \node (n-2-1) at (10.3-\deltax, 10-2*\deltay) [goal] {n-2-1};
17 \node (n-1-dots) at (10.3-2*\deltax, 10-2*\deltay) [goal] {\ldots};
18 \node (n-1-1) at (10.3-3*\deltax, 10-2*\deltay) [goal] {n-1-1};
19 %
20 \node (n-2-1-dots) at (9, 10-3*\deltay) [goal] {\ldots};
21 \node (n-2-1-1) at (9-\deltax, 10-3*\deltay) [goal] {n-2-1-1};
22 \node (n-1-1-dots) at (3.5, 10-3*\deltay) [goal] {\ldots};
23 \node (n-1-1-1) at (3.5-\deltax, 10-3*\deltay) [goal] {n-1-1-1};
24 %
25 \path (root) edge (n) ;
26 \path (n) edge (n-1) edge (n-2) edge (n-dots) ;
27 \path (n-2) edge (n-2-1) edge (n-2-dots) ;
28 \path (n-1) edge (n-1-1) edge (n-1-dots) ;
29 \path (n-2-1) edge (n-2-1-dots) edge (n-2-1-1) ;
30 \path (n-1-1) edge (n-1-1-dots) edge (n-1-1-1) ;
31 %
32 \draw[fill,color=t1c] (8.8,10-0.5*\deltay) ellipse (1.7 and 0.1) ;
33 \draw[fill,color=t2c] (7.1,10-1.5*\deltay) ellipse (3.3 and 0.1) ;
34 \draw[fill,color=t3c] (6,10-2.5*\deltay) ellipse (4.3 and 0.1) ;
35
36 \node[fill=t1c,text=white] (t1) at (7,10.8) [draw,circle] {T1};
37 \node[fill=t2c,text=white] (t2) at (3.2,10.8-\deltay) [draw,circle] {T2} ;
38 \node[fill=t3c,text=white] (t3) at (1,10.8-2*\deltay) [draw,circle] {T3} ;
39
40 \path[->] (t1) edge (n) ;
41 \path[->] (t2) edge (n-1) edge (n-2) edge (n-dots) ;
42 \path[->] (t3) edge (n-1-1) edge (n-1-dots) edge (n-2-1) edge (n-2-dots) ;
43
44 \def\foobar{1}
45 \node at (2-\foobar,10.8) {\Large :apply (} ;
46 \node[fill=t1c,text=white] at (3.3-\foobar,10.8) [draw,circle] {T1} ;
47 \node[fill=t2c,text=white] at (4.3-\foobar,10.8) [draw,circle] {T2} ;
48 \node[fill=t3c,text=white] at (5.3-\foobar,10.8) [draw,circle] {T3} ;
49 \node at (6.3-\foobar,10.8) {\Large \ldots )} ;
50 \end{tikzpicture}