forked from CS234319/safot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoilet.tex
59 lines (45 loc) · 1.97 KB
/
toilet.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\pagestyle{empty}
% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
text width=4cm, text centered, rounded corners, minimum height=4em, minimum width=4.5cm]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
minimum height=2em]
\begin{tikzpicture}[node distance = 3cm, auto]
% The nodes
\node[cloud] (business) {Business};
\node[block, below of=business] (person) {i:=person};
\node[decision, below of=person] (sex) { i.sex = male ?};
\node[decision, below of=sex, node distance=4cm] (sex2) { i.sex = pre-op transsexuel female ?};
\node[block, right of=sex2, node distance=6cm] (execution_block_1) {i.enter(toilet)\\
i.open(trousers)\\
i.target(eyes, center)\\
i.target(hands, center)
};
\node[block, below of=execution_block_1] (open_bladder) { i.open(bladder) };
\node [decision, below of=open_bladder, text width=2cm] (bladder_empty) {i.bladder = empty?};
\node[block, below of=bladder_empty] (execution_block_2) { i.close(bladder)\\
i.close(trousers)\\
i.flush(urinal)
};
\node [block, below of=execution_block_2] (exit) { i.exit() };
% The connections
\path [line] (business) -- (person);
\path [line] (person) -- (sex);
\path [line] (execution_block_1) -- (open_bladder);
\path [line] (execution_block_2) -- (exit);
\path [line] (sex) -- node [near start] {no} (sex2);
\path [line] (sex) -| node [near start] {yes} (execution_block_1);
\path [line] (sex2) -- node [near start] {no} (execution_block_1);
\path [line] (sex2) |- node [near start] {yes} (exit);
\path [line] (open_bladder) -- (bladder_empty);
\path [line] (bladder_empty) -- node [near start] {yes} (execution_block_2);
\path [line] (bladder_empty) -- +(4,0) -- +(4,3) -- node [near start] {no} (open_bladder);
\end{tikzpicture}
\end{document}