chap2-test.tex
3.74 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
\documentclass[multi={tikzpicture},crop=true,border=5pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{verbatim}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,arrows.meta,petri}
\tikzset{
>=latex,
every place/.style={minimum size=6mm},
every transition/.style={minimum size=6mm},
token distance=6pt,
}
\tikzstyle{trans}=[transition]
\tikzstyle{arc}=[->,rounded corners]
\tikzstyle{state}=[draw=blue!50!gray!50!white,
fill=blue!70!gray!10!white,
line width=2pt,
cloud,cloud puffs=8,
inner sep=-3pt]
\tikzstyle{fire}=[arrows={-Straight Barb[scale=.6]},
shorten >=-2pt, shorten <=-1pt,
draw=blue!50!gray!50!white,
fill opacity=0,
text opacity=1,
line width=2pt,
line cap=round,
rounded corners]
\tikzstyle{active}=[draw=green!50!gray!50!white,
fill=green!70!gray!10!white]
\def\matrix #1#2#3#4#5#6#7{%
{\small$\begin{array}{c@{\hspace{12pt}}c}
\multicolumn{2}{c}{#1} \\[-6pt]
#2 & #3 \\[-6pt]
\multicolumn{2}{c}{\color{red}#4} \\[-6pt]
#5 & \color{red}#6 \\[-6pt]
\multicolumn{2}{c}{#7}
\end{array}$}}
\begin{document}
%%FRAME
\begin{tikzpicture}[scale=1.2]
\node[trans,{{ active["approach"] }}] (approach) at (0,0) {};
\node[rotate=45] at (approach) {\tiny\textsf{approche}};
\node[place,tokens={{ state["before"] }}] (before) at (1,0) {};
\node[below] at (before.south) {\tiny\textsf{avant}};
\node[trans,{{ active["enter"] }}] (enter) at (2,0) {};
\node[rotate=45] at (enter) {\tiny\textsf{entre}};
\node[place,tokens={{ state["inside"] }}] (inside) at (3,0) {};
\node[below] at (inside.south) {\tiny\textsf{dedans}};
\node[trans,{{ active["exit"] }}] (exit) at (4,0) {};
\node[rotate=45] at (exit) {\tiny\textsf{sort}};
\node[place,tokens={{ state["far"] }}] (far) at (2,-1) {};
\node[below] at (far.south) {\tiny\textsf{loin}};
\draw[arc] (before) -- (enter);
\draw[arc] (enter) -- (inside);
\draw[arc] (inside) -- (exit);
\draw[arc] (exit) |- (far);
\draw[arc] (far) -| (approach);
\draw[arc] (approach) -- (before);
%
\node[place,tokens={{ state["low"] }}] (low) at (2,1) {};
\node[below] at (low.south) {\tiny\textsf{bas}};
\node[place,tokens={{ state["high"] }}] (high) at (2,3) {};
\node[above] at (high.north) {\tiny\textsf{haut}};
\node[trans,{{ active["down"] }}] (down) at (1,2) {};
\node[rotate=45] at (down) {\tiny\textsf{baisse}};
\node[trans,{{ active["up"] }}] (up) at (3,2) {};
\node[rotate=45] at (up) {\tiny\textsf{lève}};
\draw[arc] (high) -| (down);
\draw[arc] (down) |- (low);
\draw[arc] (low) -| (up);
\draw[arc] (up) |- (high);
%
\node[place,tokens={{ state["godown"] }}] (godown) at (0,2) {};
\node[above] at (godown.north) {\tiny\textsf{descendre}};
\draw[arc] (approach) -- (godown);
\draw[arc] (godown) -- (down);
\node[place,tokens={{ state["goup"] }}] (goup) at (4,2) {};
\node[above] at (goup.north) {\tiny\textsf{relever}};
\draw[arc] (exit) -- (goup);
\draw[arc] (goup) -- (up);
%
\begin{scope}[scale=2,yshift=-12mm]
\node[state,{{ active[0] }}] (0) at (0,0) {\matrix 1000001};
\node[state,{{ active[1] }}] (1) at (1,0) {\matrix 1100100};
\node[state,{{ active[2] }}] (2) at (2,0) {\matrix 0001100};
\node[state,{{ active[3] }}] (3) at (1.5,-1) {\matrix 0001010};
\node[state,{{ active[4] }}] (4) at (.5,-1) {\matrix 0011001};
\draw[fire,{{ active["approach"] }}] (0) -- node[above]{\tiny\textsf{approche}} (1);
\draw[fire,{{ active["down"] }}] (1) -- node[above]{\tiny\textsf{baisse}} (2);
\draw[fire,{{ active["enter"] }}] (2) |- node[left,pos=.1]{\tiny\textsf{entre}} (3);
\draw[fire,{{ active["exit"] }}] (3) -- node[above]{\tiny\textsf{sort}} (4);
\draw[fire,{{ active["up"] }}] (4) -| node[left,pos=.6]{\tiny\textsf{lève}} (0);
\end{scope}
\end{tikzpicture}
%%/FRAME
\end{document}