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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarytikzpetri.code.tex,v 1.3 2006/10/11 15:22:26 tantau Exp $
% Styles for places:
\tikzstyle{every place}= []
\tikzstyle{place}= [circle,draw,inner sep=0pt,
minimum size=5ex,
every place]
% Styles for transition:
\tikzstyle{every transition}= []
\tikzstyle{transition}= [rectangle,draw,inner sep=0pt,
minimum size=4mm,
every transition]
% Styles for relationship types:
\tikzstyle{pre}= [<-,shorten <=1pt]
\tikzstyle{post}= [->,shorten >=1pt]
\tikzstyle{pre and post}= [<->,shorten >=1pt,shorten <=1pt]
% Styles for marks:
\tikzstyle{every token}= []
\tikzstyle{token}= [fill=black,draw=none,circle,
inner sep=0.5pt,minimum size=1ex,
text=white,font=\tiny,every token]
\tikzoption{token distance}{\def\tikz@token@distance{#1}}
\def\tikz@token@distance{1.5ex}
\tikzstyle{children are tokens}= [growth function=\tikz@grow@tokens,edge from parent path=]
\tikzoption{tokens}{%
\ifnum#1>0\relax%
\tikz@add@after@node@path{%
{[children are tokens]child foreach \tikz@dummy in {1,...,#1} {node[token]{}}}}%
\fi}
\tikzoption{colored tokens}{%
\tikz@add@after@node@path{%
{[children are tokens]child foreach \tikz@child@color in {#1} {node[token,\tikz@child@color]{}}}}%
}
\tikzoption{structured tokens}{%
\tikz@add@after@node@path{%
{[children are tokens]child foreach \tikz@child@name in {#1} {node[token]{\tikz@child@name}}}}%
}
\def\tikz@grow@tokens{%
\setlength{\pgf@xa}{\tikz@token@distance}%
\setlength{\pgf@ya}{\tikz@token@distance}%
\pgf@xc=0pt%
\pgf@yc=0pt%
\csname tikz@grow@tokens@placer@\the\tikznumberofchildren @\the\tikznumberofcurrentchild\endcsname%
\pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
}
\def\tikz@def@grow@tokens#1#2#3#4{%
\expandafter\def\csname tikz@grow@tokens@placer@#1@#2\endcsname{%
\pgf@xc=#3\pgf@xa%
\pgf@yc=#4\pgf@ya}%
}
% Single token
\tikz@def@grow@tokens{1}{1}{0}{0}
% Two tokens
\tikz@def@grow@tokens{2}{1}{-.5}{0}
\tikz@def@grow@tokens{2}{2}{.5}{0}
% Three tokens
\tikz@def@grow@tokens{3}{1}{0} {0.57}
\tikz@def@grow@tokens{3}{2}{-.5}{-.306025}
\tikz@def@grow@tokens{3}{3}{.5} {-.306025}
% Four tokens
\tikz@def@grow@tokens{4}{1}{-.5}{.5}
\tikz@def@grow@tokens{4}{2}{.5}{.5}
\tikz@def@grow@tokens{4}{3}{-.5}{-.5}
\tikz@def@grow@tokens{4}{4}{.5}{-.5}
% Five tokens
\tikz@def@grow@tokens{5}{1}{0}{.85}
\tikz@def@grow@tokens{5}{2}{-0.808398}{0.26266}
\tikz@def@grow@tokens{5}{3}{0.808398}{0.26266}
\tikz@def@grow@tokens{5}{4}{-0.499617}{-0.687664}
\tikz@def@grow@tokens{5}{5}{0.499617}{-0.687664}
% Six tokens
\tikz@def@grow@tokens{6}{1}{-1}{.5}
\tikz@def@grow@tokens{6}{2}{0}{.5}
\tikz@def@grow@tokens{6}{3}{1}{.5}
\tikz@def@grow@tokens{6}{4}{-1}{-.5}
\tikz@def@grow@tokens{6}{5}{0}{-.5}
\tikz@def@grow@tokens{6}{6}{1}{-.5}
% Seven tokens
\tikz@def@grow@tokens{7}{1}{0}{1}
\tikz@def@grow@tokens{7}{2}{-1}{.5}
\tikz@def@grow@tokens{7}{3}{0}{0}
\tikz@def@grow@tokens{7}{4}{1}{.5}
\tikz@def@grow@tokens{7}{5}{-1}{-.5}
\tikz@def@grow@tokens{7}{6}{0}{-1}
\tikz@def@grow@tokens{7}{7}{1}{-.5}
% Eight tokens
\tikz@def@grow@tokens{8}{1}{-.5}{1}
\tikz@def@grow@tokens{8}{2}{.5}{1}
\tikz@def@grow@tokens{8}{3}{-1}{0}
\tikz@def@grow@tokens{8}{4}{0}{0}
\tikz@def@grow@tokens{8}{5}{1}{0}
\tikz@def@grow@tokens{8}{6}{-1}{-1}
\tikz@def@grow@tokens{8}{7}{0}{-1}
\tikz@def@grow@tokens{8}{8}{1}{-1}
% Eight tokens
\tikz@def@grow@tokens{9}{1}{-1}{1}
\tikz@def@grow@tokens{9}{2}{0}{1}
\tikz@def@grow@tokens{9}{3}{1}{1}
\tikz@def@grow@tokens{9}{4}{-1}{0}
\tikz@def@grow@tokens{9}{5}{0}{0}
\tikz@def@grow@tokens{9}{6}{1}{0}
\tikz@def@grow@tokens{9}{7}{-1}{-1}
\tikz@def@grow@tokens{9}{8}{0}{-1}
\tikz@def@grow@tokens{9}{9}{1}{-1}
\endinput
|