y_nelson 2.0.8 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Introduction_to_YNelson.lyx +3701 -0
- data/YNelson_&_YPetri_User_Manual.lyx +1037 -0
- data/YNelson_&_YPetri_User_Manual.pdf +0 -0
- data/{YNelson_FPN_&_ZZ_domain_model_hands_on_in_color.lyx → YNelson_-_Hands-on_Tutorial.lyx} +1 -1
- data/{YNelson_FPN_&_ZZ_domain_model_hands_on_in_color.pdf → YNelson_-_Hands-on_Tutorial.pdf} +0 -0
- data/lib/y_nelson/version.rb +1 -1
- metadata +7 -4
@@ -0,0 +1,1037 @@
|
|
1
|
+
#LyX 2.0 created this file. For more info see http://www.lyx.org/
|
2
|
+
\lyxformat 413
|
3
|
+
\begin_document
|
4
|
+
\begin_header
|
5
|
+
\textclass article
|
6
|
+
\use_default_options false
|
7
|
+
\maintain_unincluded_children false
|
8
|
+
\language english
|
9
|
+
\language_package default
|
10
|
+
\inputencoding auto
|
11
|
+
\fontencoding global
|
12
|
+
\font_roman default
|
13
|
+
\font_sans default
|
14
|
+
\font_typewriter default
|
15
|
+
\font_default_family default
|
16
|
+
\use_non_tex_fonts false
|
17
|
+
\font_sc false
|
18
|
+
\font_osf false
|
19
|
+
\font_sf_scale 100
|
20
|
+
\font_tt_scale 100
|
21
|
+
|
22
|
+
\graphics default
|
23
|
+
\default_output_format default
|
24
|
+
\output_sync 0
|
25
|
+
\bibtex_command default
|
26
|
+
\index_command default
|
27
|
+
\paperfontsize default
|
28
|
+
\spacing single
|
29
|
+
\use_hyperref false
|
30
|
+
\papersize default
|
31
|
+
\use_geometry true
|
32
|
+
\use_amsmath 1
|
33
|
+
\use_esint 1
|
34
|
+
\use_mhchem 1
|
35
|
+
\use_mathdots 1
|
36
|
+
\cite_engine natbib_authoryear
|
37
|
+
\use_bibtopic false
|
38
|
+
\use_indices false
|
39
|
+
\paperorientation portrait
|
40
|
+
\suppress_date false
|
41
|
+
\use_refstyle 0
|
42
|
+
\index Index
|
43
|
+
\shortcut idx
|
44
|
+
\color #008000
|
45
|
+
\end_index
|
46
|
+
\leftmargin 2.2cm
|
47
|
+
\topmargin 3cm
|
48
|
+
\rightmargin 2.2cm
|
49
|
+
\bottommargin 3cm
|
50
|
+
\secnumdepth 3
|
51
|
+
\tocdepth 3
|
52
|
+
\paragraph_separation indent
|
53
|
+
\paragraph_indentation default
|
54
|
+
\quotes_language english
|
55
|
+
\papercolumns 1
|
56
|
+
\papersides 1
|
57
|
+
\paperpagestyle default
|
58
|
+
\tracking_changes false
|
59
|
+
\output_changes false
|
60
|
+
\html_math_output 0
|
61
|
+
\html_css_as_file 0
|
62
|
+
\html_be_strict false
|
63
|
+
\end_header
|
64
|
+
|
65
|
+
\begin_body
|
66
|
+
|
67
|
+
\begin_layout Title
|
68
|
+
YNelson & YPetri – User Manual
|
69
|
+
\end_layout
|
70
|
+
|
71
|
+
\begin_layout Part*
|
72
|
+
What is YNelson
|
73
|
+
\end_layout
|
74
|
+
|
75
|
+
\begin_layout Standard
|
76
|
+
|
77
|
+
\family typewriter
|
78
|
+
\color blue
|
79
|
+
YNelson
|
80
|
+
\family default
|
81
|
+
\color inherit
|
82
|
+
is a Ruby library (gem) providing the domain model and simulator of
|
83
|
+
\emph on
|
84
|
+
\color green
|
85
|
+
Nelson nets
|
86
|
+
\emph default
|
87
|
+
\color inherit
|
88
|
+
, and the domain-specific language (DSL) to handle them.
|
89
|
+
A
|
90
|
+
\emph on
|
91
|
+
\color green
|
92
|
+
Nelson net
|
93
|
+
\emph default
|
94
|
+
\color inherit
|
95
|
+
is a cross between a
|
96
|
+
\emph on
|
97
|
+
\color green
|
98
|
+
Petri net
|
99
|
+
\emph default
|
100
|
+
\color inherit
|
101
|
+
, and a
|
102
|
+
\emph on
|
103
|
+
\color green
|
104
|
+
ZZ structure
|
105
|
+
\emph default
|
106
|
+
\color inherit
|
107
|
+
(as described by Ted Nelson, ...).
|
108
|
+
In accordance with this,
|
109
|
+
\family typewriter
|
110
|
+
YNelson
|
111
|
+
\family default
|
112
|
+
is a combination of two major dependencies:
|
113
|
+
\family typewriter
|
114
|
+
\color blue
|
115
|
+
YPetri
|
116
|
+
\family default
|
117
|
+
\color inherit
|
118
|
+
gem, providing the the domain model of Petri nets, and
|
119
|
+
\family typewriter
|
120
|
+
\color blue
|
121
|
+
Yzz
|
122
|
+
\family default
|
123
|
+
\color inherit
|
124
|
+
gem, providing the domain model of ZZ structures.
|
125
|
+
At the moment being, the focus of the development (and this user manual)
|
126
|
+
is the Petri net model –
|
127
|
+
\family typewriter
|
128
|
+
YPetri
|
129
|
+
\family default
|
130
|
+
.
|
131
|
+
Since
|
132
|
+
\family typewriter
|
133
|
+
YNelson
|
134
|
+
\family default
|
135
|
+
provides the same interface to the Petri net model as
|
136
|
+
\family typewriter
|
137
|
+
YPetri
|
138
|
+
\family default
|
139
|
+
, this text can also serve as a user manual to plain
|
140
|
+
\family typewriter
|
141
|
+
YPetri
|
142
|
+
\family default
|
143
|
+
.
|
144
|
+
As for the ZZ structures, they are a promising data structure acting as
|
145
|
+
a non-SQL relational database, but their use by YNelson is still under
|
146
|
+
development – ZZ structures are so basic, that it's not clear, how deep
|
147
|
+
in the object model should their usage go.
|
148
|
+
\end_layout
|
149
|
+
|
150
|
+
\begin_layout Standard
|
151
|
+
|
152
|
+
\family typewriter
|
153
|
+
YNelson
|
154
|
+
\family default
|
155
|
+
requires Ruby 2.1, and can be installed from the command line by
|
156
|
+
\begin_inset Quotes eld
|
157
|
+
\end_inset
|
158
|
+
|
159
|
+
|
160
|
+
\family typewriter
|
161
|
+
gem install y_nelson
|
162
|
+
\family default
|
163
|
+
|
164
|
+
\begin_inset Quotes erd
|
165
|
+
\end_inset
|
166
|
+
|
167
|
+
.
|
168
|
+
The main dependencies,
|
169
|
+
\family typewriter
|
170
|
+
Yzz
|
171
|
+
\family default
|
172
|
+
and
|
173
|
+
\family typewriter
|
174
|
+
YPetri
|
175
|
+
\family default
|
176
|
+
, should install automatically, but can be installed manually by
|
177
|
+
\begin_inset Quotes eld
|
178
|
+
\end_inset
|
179
|
+
|
180
|
+
|
181
|
+
\family typewriter
|
182
|
+
gem install y_petri
|
183
|
+
\family default
|
184
|
+
|
185
|
+
\begin_inset Quotes erd
|
186
|
+
\end_inset
|
187
|
+
|
188
|
+
and
|
189
|
+
\begin_inset Quotes eld
|
190
|
+
\end_inset
|
191
|
+
|
192
|
+
|
193
|
+
\family typewriter
|
194
|
+
gem install y
|
195
|
+
\family default
|
196
|
+
zz
|
197
|
+
\begin_inset Quotes erd
|
198
|
+
\end_inset
|
199
|
+
|
200
|
+
.
|
201
|
+
\end_layout
|
202
|
+
|
203
|
+
\begin_layout Part*
|
204
|
+
Functional Petri nets
|
205
|
+
\end_layout
|
206
|
+
|
207
|
+
\begin_layout Standard
|
208
|
+
Petri nets were described by C.
|
209
|
+
A.
|
210
|
+
Petri in the middle of 20th century.
|
211
|
+
A Petri net can be used to represent various
|
212
|
+
\begin_inset Quotes eld
|
213
|
+
\end_inset
|
214
|
+
|
215
|
+
wiring diagrams
|
216
|
+
\begin_inset Quotes erd
|
217
|
+
\end_inset
|
218
|
+
|
219
|
+
– such as production lines, rail networks, electronic circuits, computer
|
220
|
+
architectures, parallel execution diagrams, or chemical systems.
|
221
|
+
In fact, already Petri himself proposet to use Petri nets for modeling
|
222
|
+
chemical reactions.
|
223
|
+
In other words, chemical network modeling was one of the design goals of
|
224
|
+
Petri nets since their inception.
|
225
|
+
\end_layout
|
226
|
+
|
227
|
+
\begin_layout Standard
|
228
|
+
A Petri net diagram consists of
|
229
|
+
\emph on
|
230
|
+
\color green
|
231
|
+
places
|
232
|
+
\emph default
|
233
|
+
\color inherit
|
234
|
+
,
|
235
|
+
\emph on
|
236
|
+
\color green
|
237
|
+
transitions
|
238
|
+
\emph default
|
239
|
+
\color inherit
|
240
|
+
, and
|
241
|
+
\emph on
|
242
|
+
\color green
|
243
|
+
arcs
|
244
|
+
\emph default
|
245
|
+
\color inherit
|
246
|
+
.
|
247
|
+
Places are typically drawn as circles, transitions as rectangles, and arcs
|
248
|
+
as lines or arrows connecting places and transitions.
|
249
|
+
Petri net places may contain
|
250
|
+
\emph on
|
251
|
+
\color green
|
252
|
+
tokens
|
253
|
+
\emph default
|
254
|
+
\color inherit
|
255
|
+
.
|
256
|
+
Another word for a number of token in a place(s) is
|
257
|
+
\emph on
|
258
|
+
\color green
|
259
|
+
marking
|
260
|
+
\emph default
|
261
|
+
\color inherit
|
262
|
+
.
|
263
|
+
In
|
264
|
+
\family typewriter
|
265
|
+
YNelson
|
266
|
+
\family default
|
267
|
+
, the amount of tokens (place's marking) is represented by a number attached
|
268
|
+
to the place.
|
269
|
+
When transitions operate (
|
270
|
+
\emph on
|
271
|
+
\color green
|
272
|
+
fire
|
273
|
+
\emph default
|
274
|
+
\color inherit
|
275
|
+
), tokens are added to or removed from the places, to which the transition
|
276
|
+
is connected.
|
277
|
+
It is the property of Petri nets, that their
|
278
|
+
\emph on
|
279
|
+
\color green
|
280
|
+
state
|
281
|
+
\emph default
|
282
|
+
\color inherit
|
283
|
+
is fully expressed by the places' marking – the transitions are completely
|
284
|
+
stateless.
|
285
|
+
\end_layout
|
286
|
+
|
287
|
+
\begin_layout Standard
|
288
|
+
Original Petri nets were
|
289
|
+
\emph on
|
290
|
+
\color green
|
291
|
+
timeless
|
292
|
+
\emph default
|
293
|
+
\color inherit
|
294
|
+
.
|
295
|
+
In a timeless Petri net, transition firing is a discrete event, whose exact
|
296
|
+
timing is not specified.
|
297
|
+
Instead, a timeless Petri net specifies the conditions, under which a transitio
|
298
|
+
n is
|
299
|
+
\emph on
|
300
|
+
\color green
|
301
|
+
enabled
|
302
|
+
\emph default
|
303
|
+
\color inherit
|
304
|
+
–
|
305
|
+
\emph on
|
306
|
+
allowed
|
307
|
+
\emph default
|
308
|
+
to fire, or
|
309
|
+
\emph on
|
310
|
+
\color green
|
311
|
+
disabled
|
312
|
+
\emph default
|
313
|
+
\color inherit
|
314
|
+
– is
|
315
|
+
\emph on
|
316
|
+
prohibited
|
317
|
+
\emph default
|
318
|
+
to fire.
|
319
|
+
Typically, a transition in a timeless Petri net is generally enabled, when
|
320
|
+
its input arcs have enough tokens for firing to happen, though other firing
|
321
|
+
conditions may be specified.
|
322
|
+
Timeless Petri nets are generally used to investigate concurrency – things
|
323
|
+
like race conditions, network congestions, state reachability etc.
|
324
|
+
Interaction with timeless Petri nets is called
|
325
|
+
\emph on
|
326
|
+
\color green
|
327
|
+
token game
|
328
|
+
\emph default
|
329
|
+
\color inherit
|
330
|
+
.
|
331
|
+
\end_layout
|
332
|
+
|
333
|
+
\begin_layout Standard
|
334
|
+
|
335
|
+
\emph on
|
336
|
+
\color green
|
337
|
+
Timed Petri nets
|
338
|
+
\emph default
|
339
|
+
\color inherit
|
340
|
+
operate in time.
|
341
|
+
They specify when (or how rapidly) the transitions firing occurs.
|
342
|
+
(The specification may be of stochastic.) Whereas a timeless Petri net requires
|
343
|
+
the user to play the token game, timed Petri net can be
|
344
|
+
\emph on
|
345
|
+
\color green
|
346
|
+
executed
|
347
|
+
\emph default
|
348
|
+
\color inherit
|
349
|
+
in time.
|
350
|
+
Timed Petri nets actually represent a wiring diagram of a dynamic system,
|
351
|
+
from which a set of differential equations describing the system can be
|
352
|
+
derived.
|
353
|
+
Even if the differential equations are not expressed explicitly, execution
|
354
|
+
of a timed Petri net is tantamount to numeric integration of its equivalent
|
355
|
+
DE system.
|
356
|
+
\end_layout
|
357
|
+
|
358
|
+
\begin_layout Part*
|
359
|
+
YPetri object model
|
360
|
+
\end_layout
|
361
|
+
|
362
|
+
\begin_layout Subsection*
|
363
|
+
|
364
|
+
\family typewriter
|
365
|
+
Place
|
366
|
+
\family default
|
367
|
+
,
|
368
|
+
\family typewriter
|
369
|
+
Transition
|
370
|
+
\family default
|
371
|
+
and
|
372
|
+
\family typewriter
|
373
|
+
Net
|
374
|
+
\family default
|
375
|
+
class
|
376
|
+
\end_layout
|
377
|
+
|
378
|
+
\begin_layout Standard
|
379
|
+
The main classes of
|
380
|
+
\family typewriter
|
381
|
+
YPetri
|
382
|
+
\family default
|
383
|
+
object model are
|
384
|
+
\family typewriter
|
385
|
+
Place
|
386
|
+
\family default
|
387
|
+
,
|
388
|
+
\family typewriter
|
389
|
+
Transition
|
390
|
+
\family default
|
391
|
+
, and
|
392
|
+
\family typewriter
|
393
|
+
Net
|
394
|
+
\family default
|
395
|
+
.
|
396
|
+
A
|
397
|
+
\family typewriter
|
398
|
+
Net
|
399
|
+
\family default
|
400
|
+
instance represents a Petri net, consisting of
|
401
|
+
\family typewriter
|
402
|
+
Place
|
403
|
+
\family default
|
404
|
+
instances and
|
405
|
+
\family typewriter
|
406
|
+
Transition
|
407
|
+
\family default
|
408
|
+
instances.
|
409
|
+
|
410
|
+
\family typewriter
|
411
|
+
Net
|
412
|
+
\family default
|
413
|
+
class is a (subclass of)
|
414
|
+
\family typewriter
|
415
|
+
Module
|
416
|
+
\family default
|
417
|
+
class, so places and transitions can simply be defined as its constants.
|
418
|
+
If a transition belongs to a net, all the places connected to it must belong
|
419
|
+
to the same net.
|
420
|
+
\end_layout
|
421
|
+
|
422
|
+
\begin_layout Standard
|
423
|
+
Transitions can be divided into ...
|
424
|
+
s / S, t / T, a / A ...
|
425
|
+
this gives 5 basic types ...
|
426
|
+
\end_layout
|
427
|
+
|
428
|
+
\begin_layout Subsection*
|
429
|
+
|
430
|
+
\family typewriter
|
431
|
+
Simulation
|
432
|
+
\family default
|
433
|
+
and
|
434
|
+
\family typewriter
|
435
|
+
Core
|
436
|
+
\family default
|
437
|
+
class
|
438
|
+
\end_layout
|
439
|
+
|
440
|
+
\begin_layout Standard
|
441
|
+
|
442
|
+
\family typewriter
|
443
|
+
Simulation
|
444
|
+
\family default
|
445
|
+
class represents a simulation of a particular network, with particular
|
446
|
+
simulation settings.
|
447
|
+
|
448
|
+
\family typewriter
|
449
|
+
Core
|
450
|
+
\family default
|
451
|
+
class represents the simulator – a machine that performs the execution
|
452
|
+
of a Petri net.
|
453
|
+
When a simulation instance wants to proceed in time to a next state, it
|
454
|
+
realies on a
|
455
|
+
\family typewriter
|
456
|
+
Core
|
457
|
+
\family default
|
458
|
+
instance to perform the computation.
|
459
|
+
\end_layout
|
460
|
+
|
461
|
+
\begin_layout Standard
|
462
|
+
|
463
|
+
\family typewriter
|
464
|
+
Simulation
|
465
|
+
\family default
|
466
|
+
– Public instance methods
|
467
|
+
\end_layout
|
468
|
+
|
469
|
+
\begin_layout Standard
|
470
|
+
place access:
|
471
|
+
\end_layout
|
472
|
+
|
473
|
+
\begin_layout Standard
|
474
|
+
...
|
475
|
+
\end_layout
|
476
|
+
|
477
|
+
\begin_layout Standard
|
478
|
+
transition access:
|
479
|
+
\end_layout
|
480
|
+
|
481
|
+
\begin_layout Standard
|
482
|
+
...
|
483
|
+
\end_layout
|
484
|
+
|
485
|
+
\begin_layout Standard
|
486
|
+
element access:
|
487
|
+
\end_layout
|
488
|
+
|
489
|
+
\begin_layout Standard
|
490
|
+
...
|
491
|
+
\end_layout
|
492
|
+
|
493
|
+
\begin_layout Standard
|
494
|
+
inital marking access:
|
495
|
+
\end_layout
|
496
|
+
|
497
|
+
\begin_layout Standard
|
498
|
+
...
|
499
|
+
\end_layout
|
500
|
+
|
501
|
+
\begin_layout Standard
|
502
|
+
marking clamp access:
|
503
|
+
\end_layout
|
504
|
+
|
505
|
+
\begin_layout Standard
|
506
|
+
...
|
507
|
+
\end_layout
|
508
|
+
|
509
|
+
\begin_layout Standard
|
510
|
+
marking vector access:
|
511
|
+
\end_layout
|
512
|
+
|
513
|
+
\begin_layout Standard
|
514
|
+
m_vector – as a column vector
|
515
|
+
\end_layout
|
516
|
+
|
517
|
+
\begin_layout Standard
|
518
|
+
m – as an array
|
519
|
+
\end_layout
|
520
|
+
|
521
|
+
\begin_layout Standard
|
522
|
+
place_m – as place => value hash
|
523
|
+
\end_layout
|
524
|
+
|
525
|
+
\begin_layout Standard
|
526
|
+
p_m – as place name => value hash
|
527
|
+
\end_layout
|
528
|
+
|
529
|
+
\begin_layout Standard
|
530
|
+
pm – pretty prints the name => value hash
|
531
|
+
\end_layout
|
532
|
+
|
533
|
+
\begin_layout Standard
|
534
|
+
update_m – modifies the marking vector
|
535
|
+
\end_layout
|
536
|
+
|
537
|
+
\begin_layout Standard
|
538
|
+
marking_vector – as m_vector, for free places only
|
539
|
+
\end_layout
|
540
|
+
|
541
|
+
\begin_layout Standard
|
542
|
+
marking – as m, for free places only
|
543
|
+
\end_layout
|
544
|
+
|
545
|
+
\begin_layout Standard
|
546
|
+
place_marking – as place_m, for free places only
|
547
|
+
\end_layout
|
548
|
+
|
549
|
+
\begin_layout Standard
|
550
|
+
p_marking – as p_m, for free places only
|
551
|
+
\end_layout
|
552
|
+
|
553
|
+
\begin_layout Standard
|
554
|
+
update_marking – as update_m, but the places must be free places only
|
555
|
+
\end_layout
|
556
|
+
|
557
|
+
\begin_layout Standard
|
558
|
+
increment_marking – increments the marking vector with a supplied difference
|
559
|
+
vector (whose positions corresponds to free places)
|
560
|
+
\end_layout
|
561
|
+
|
562
|
+
\begin_layout Standard
|
563
|
+
...
|
564
|
+
\end_layout
|
565
|
+
|
566
|
+
\begin_layout Standard
|
567
|
+
own methods:
|
568
|
+
\end_layout
|
569
|
+
|
570
|
+
\begin_layout Standard
|
571
|
+
firing – returns firing of the indicated tS transitions
|
572
|
+
\end_layout
|
573
|
+
|
574
|
+
\begin_layout Standard
|
575
|
+
t_firing – same as has transition name => firing
|
576
|
+
\end_layout
|
577
|
+
|
578
|
+
\begin_layout Standard
|
579
|
+
pfiring – pretty prints firing
|
580
|
+
\end_layout
|
581
|
+
|
582
|
+
\begin_layout Standard
|
583
|
+
??? flux
|
584
|
+
\end_layout
|
585
|
+
|
586
|
+
\begin_layout Standard
|
587
|
+
??? t_flux
|
588
|
+
\end_layout
|
589
|
+
|
590
|
+
\begin_layout Standard
|
591
|
+
??? pflux
|
592
|
+
\end_layout
|
593
|
+
|
594
|
+
\begin_layout Standard
|
595
|
+
??? gradient
|
596
|
+
\end_layout
|
597
|
+
|
598
|
+
\begin_layout Standard
|
599
|
+
??? p_gradient
|
600
|
+
\end_layout
|
601
|
+
|
602
|
+
\begin_layout Standard
|
603
|
+
??? pgradient
|
604
|
+
\end_layout
|
605
|
+
|
606
|
+
\begin_layout Standard
|
607
|
+
??? delta
|
608
|
+
\end_layout
|
609
|
+
|
610
|
+
\begin_layout Standard
|
611
|
+
??? p_delta
|
612
|
+
\end_layout
|
613
|
+
|
614
|
+
\begin_layout Standard
|
615
|
+
??? pdelta
|
616
|
+
\end_layout
|
617
|
+
|
618
|
+
\begin_layout Standard
|
619
|
+
...
|
620
|
+
\end_layout
|
621
|
+
|
622
|
+
\begin_layout Standard
|
623
|
+
Core class is a bit intimate to YPetri, it is not directly controlled by
|
624
|
+
the user.
|
625
|
+
\end_layout
|
626
|
+
|
627
|
+
\begin_layout Standard
|
628
|
+
|
629
|
+
\family typewriter
|
630
|
+
Core
|
631
|
+
\family default
|
632
|
+
– Public class methods
|
633
|
+
\end_layout
|
634
|
+
|
635
|
+
\begin_layout Standard
|
636
|
+
new – constructor
|
637
|
+
\end_layout
|
638
|
+
|
639
|
+
\begin_layout Standard
|
640
|
+
using_simulation_method( symbol, guarded: false ) – constructor
|
641
|
+
\end_layout
|
642
|
+
|
643
|
+
\begin_layout Standard
|
644
|
+
|
645
|
+
\family typewriter
|
646
|
+
Core
|
647
|
+
\family default
|
648
|
+
– Public instance methods
|
649
|
+
\end_layout
|
650
|
+
|
651
|
+
\begin_layout Standard
|
652
|
+
guarded?
|
653
|
+
\end_layout
|
654
|
+
|
655
|
+
\begin_layout Standard
|
656
|
+
delta_timeless
|
657
|
+
\end_layout
|
658
|
+
|
659
|
+
\begin_layout Standard
|
660
|
+
delta_tS
|
661
|
+
\end_layout
|
662
|
+
|
663
|
+
\begin_layout Standard
|
664
|
+
delta_ts
|
665
|
+
\end_layout
|
666
|
+
|
667
|
+
\begin_layout Standard
|
668
|
+
firing_vector_tS
|
669
|
+
\end_layout
|
670
|
+
|
671
|
+
\begin_layout Standard
|
672
|
+
increment_marking_vector( delta )
|
673
|
+
\end_layout
|
674
|
+
|
675
|
+
\begin_layout Standard
|
676
|
+
assignment_transitions_all_fire!
|
677
|
+
\end_layout
|
678
|
+
|
679
|
+
\begin_layout Subsection*
|
680
|
+
|
681
|
+
\family typewriter
|
682
|
+
Net::State
|
683
|
+
\family default
|
684
|
+
, state features, and
|
685
|
+
\family typewriter
|
686
|
+
Record
|
687
|
+
\end_layout
|
688
|
+
|
689
|
+
\begin_layout Standard
|
690
|
+
A particular Petri net, as mentioned earlier, may have state, which is entirely
|
691
|
+
given by the marking vector of its places.
|
692
|
+
This state is represented in YPetri by Net::State class.
|
693
|
+
Furthermore, a net in a particular state can have various features defined
|
694
|
+
on it.
|
695
|
+
A feature is represented by
|
696
|
+
\family typewriter
|
697
|
+
Net::State::Feature
|
698
|
+
\family default
|
699
|
+
class.
|
700
|
+
At the moment being, following features are supported:
|
701
|
+
\family typewriter
|
702
|
+
Marking
|
703
|
+
\family default
|
704
|
+
,
|
705
|
+
\family typewriter
|
706
|
+
Firing
|
707
|
+
\family default
|
708
|
+
,
|
709
|
+
\family typewriter
|
710
|
+
Flux
|
711
|
+
\family default
|
712
|
+
,
|
713
|
+
\family typewriter
|
714
|
+
Gradient
|
715
|
+
\family default
|
716
|
+
and
|
717
|
+
\family typewriter
|
718
|
+
Delta
|
719
|
+
\family default
|
720
|
+
.
|
721
|
+
For each feature, measurement can be performed on a net in a particular
|
722
|
+
state, returning the feature's value.
|
723
|
+
A collection of such features is called a feature set, and is represented
|
724
|
+
by
|
725
|
+
\family typewriter
|
726
|
+
Net::State::Features
|
727
|
+
\family default
|
728
|
+
class in
|
729
|
+
\family typewriter
|
730
|
+
YPetri
|
731
|
+
\family default
|
732
|
+
.
|
733
|
+
Measurement performed for a particular feature set results in a
|
734
|
+
\family typewriter
|
735
|
+
Record
|
736
|
+
\family default
|
737
|
+
instance.
|
738
|
+
Record is an Array subclass, but it remembers the features to which the
|
739
|
+
stored values correspond.
|
740
|
+
\end_layout
|
741
|
+
|
742
|
+
\begin_layout Standard
|
743
|
+
|
744
|
+
\family typewriter
|
745
|
+
Feature
|
746
|
+
\family default
|
747
|
+
– Public instance methods
|
748
|
+
\end_layout
|
749
|
+
|
750
|
+
\begin_layout Standard
|
751
|
+
extract_from( target, **nn ) – extracts the feature from the given target
|
752
|
+
object.
|
753
|
+
The target object must own a net state for the same net, for which this
|
754
|
+
state feature was defined.
|
755
|
+
\end_layout
|
756
|
+
|
757
|
+
\begin_layout Standard
|
758
|
+
label – label for this feature (to use in graphics etc.)
|
759
|
+
\end_layout
|
760
|
+
|
761
|
+
\begin_layout Standard
|
762
|
+
...
|
763
|
+
\end_layout
|
764
|
+
|
765
|
+
\begin_layout Standard
|
766
|
+
|
767
|
+
\family typewriter
|
768
|
+
Features
|
769
|
+
\family default
|
770
|
+
– Public class methods
|
771
|
+
\end_layout
|
772
|
+
|
773
|
+
\begin_layout Standard
|
774
|
+
new – Constructor / instance reference
|
775
|
+
\end_layout
|
776
|
+
|
777
|
+
\begin_layout Standard
|
778
|
+
marking, flux, firing, gradient, delta – Features instance reference
|
779
|
+
\end_layout
|
780
|
+
|
781
|
+
\begin_layout Standard
|
782
|
+
|
783
|
+
\family typewriter
|
784
|
+
Features
|
785
|
+
\family default
|
786
|
+
– Public instance methods
|
787
|
+
\end_layout
|
788
|
+
|
789
|
+
\begin_layout Standard
|
790
|
+
extract_from( target, **nn ) - extracts the feature set from a given target,
|
791
|
+
returning a Record instance.
|
792
|
+
\end_layout
|
793
|
+
|
794
|
+
\begin_layout Standard
|
795
|
+
new_record( values ) – Record instance constructor
|
796
|
+
\end_layout
|
797
|
+
|
798
|
+
\begin_layout Standard
|
799
|
+
+, -, * – same as for arrays
|
800
|
+
\end_layout
|
801
|
+
|
802
|
+
\begin_layout Standard
|
803
|
+
labels – feature labels
|
804
|
+
\end_layout
|
805
|
+
|
806
|
+
\begin_layout Standard
|
807
|
+
reduce_features –
|
808
|
+
\end_layout
|
809
|
+
|
810
|
+
\begin_layout Standard
|
811
|
+
marking, flux, firing, gradient, delta – feature reduction
|
812
|
+
\end_layout
|
813
|
+
|
814
|
+
\begin_layout Standard
|
815
|
+
...
|
816
|
+
\end_layout
|
817
|
+
|
818
|
+
\begin_layout Standard
|
819
|
+
|
820
|
+
\family typewriter
|
821
|
+
State
|
822
|
+
\family default
|
823
|
+
-- Public class methods
|
824
|
+
\end_layout
|
825
|
+
|
826
|
+
\begin_layout Standard
|
827
|
+
feature -- Feature instance reference
|
828
|
+
\end_layout
|
829
|
+
|
830
|
+
\begin_layout Standard
|
831
|
+
features – Features (feature set) instance reference
|
832
|
+
\end_layout
|
833
|
+
|
834
|
+
\begin_layout Standard
|
835
|
+
marking, flux, firing, gradient, delta – Features instance reference
|
836
|
+
\end_layout
|
837
|
+
|
838
|
+
\begin_layout Standard
|
839
|
+
|
840
|
+
\family typewriter
|
841
|
+
State
|
842
|
+
\family default
|
843
|
+
-- Public instance method
|
844
|
+
\end_layout
|
845
|
+
|
846
|
+
\begin_layout Standard
|
847
|
+
...
|
848
|
+
\end_layout
|
849
|
+
|
850
|
+
\begin_layout Standard
|
851
|
+
|
852
|
+
\family typewriter
|
853
|
+
Record
|
854
|
+
\family default
|
855
|
+
-- Public class methods
|
856
|
+
\end_layout
|
857
|
+
|
858
|
+
\begin_layout Standard
|
859
|
+
features – returns the features to which the record values correspond
|
860
|
+
\end_layout
|
861
|
+
|
862
|
+
\begin_layout Standard
|
863
|
+
load( values ) - constructs a new Record object from a given collection
|
864
|
+
of values.
|
865
|
+
\end_layout
|
866
|
+
|
867
|
+
\begin_layout Standard
|
868
|
+
Record -- Public instance methods
|
869
|
+
\end_layout
|
870
|
+
|
871
|
+
\begin_layout Standard
|
872
|
+
marking, firing, flux, gradient, delta – feature extraction from a record
|
873
|
+
\end_layout
|
874
|
+
|
875
|
+
\begin_layout Standard
|
876
|
+
fetch( feature ) – single feature extraction from a record
|
877
|
+
\end_layout
|
878
|
+
|
879
|
+
\begin_layout Standard
|
880
|
+
dump – should it be renamed to #to_a?
|
881
|
+
\end_layout
|
882
|
+
|
883
|
+
\begin_layout Standard
|
884
|
+
print – pretty prints the records with feature names
|
885
|
+
\end_layout
|
886
|
+
|
887
|
+
\begin_layout Standard
|
888
|
+
state( marking_clamps: {} ) – returns the state instance implied by the
|
889
|
+
record and the supplied complementary set of marking clamps
|
890
|
+
\end_layout
|
891
|
+
|
892
|
+
\begin_layout Standard
|
893
|
+
reconstruct( **settings ) – reconstructs a simulation instance from the
|
894
|
+
record and the given simulation settings
|
895
|
+
\end_layout
|
896
|
+
|
897
|
+
\begin_layout Standard
|
898
|
+
euclidean_distance( other ) – computes the Euclidean distance to another
|
899
|
+
record with the same feature set.
|
900
|
+
\end_layout
|
901
|
+
|
902
|
+
\begin_layout Subsection*
|
903
|
+
|
904
|
+
\family typewriter
|
905
|
+
DataSet
|
906
|
+
\family default
|
907
|
+
class
|
908
|
+
\end_layout
|
909
|
+
|
910
|
+
\begin_layout Standard
|
911
|
+
...
|
912
|
+
\end_layout
|
913
|
+
|
914
|
+
\begin_layout Standard
|
915
|
+
|
916
|
+
\family typewriter
|
917
|
+
DataSet
|
918
|
+
\family default
|
919
|
+
-- Public instance methods
|
920
|
+
\end_layout
|
921
|
+
|
922
|
+
\begin_layout Standard
|
923
|
+
net – a dataset knows its net
|
924
|
+
\end_layout
|
925
|
+
|
926
|
+
\begin_layout Standard
|
927
|
+
reduce_features – selects certain columns (features) of a dataset.
|
928
|
+
\end_layout
|
929
|
+
|
930
|
+
\begin_layout Standard
|
931
|
+
slice – since DataSet is a Hash subclass, YSupport's Hash#slice method is
|
932
|
+
available to it, and can be used to select only certain rows (records)
|
933
|
+
of a dataset.
|
934
|
+
\end_layout
|
935
|
+
|
936
|
+
\begin_layout Standard
|
937
|
+
marking, firing, flux, gradient, delta – additional convenience methods
|
938
|
+
for selecting particular columns and rows from the dataset
|
939
|
+
\end_layout
|
940
|
+
|
941
|
+
\begin_layout Standard
|
942
|
+
record( event ) – returns the record instance for a given recorded key
|
943
|
+
\end_layout
|
944
|
+
|
945
|
+
\begin_layout Standard
|
946
|
+
floor( event ), ceiling( event ) – given a key value, they return the nearest
|
947
|
+
record actually present in the dataset – floor returns the nearest lower
|
948
|
+
or equal, ceiling the nearest higher or equal record.
|
949
|
+
\end_layout
|
950
|
+
|
951
|
+
\begin_layout Standard
|
952
|
+
interpolate( event ) – Interpolates a record for a given key.
|
953
|
+
\end_layout
|
954
|
+
|
955
|
+
\begin_layout Standard
|
956
|
+
print – pretty-prints the dataset
|
957
|
+
\end_layout
|
958
|
+
|
959
|
+
\begin_layout Standard
|
960
|
+
plot – plots the dataset
|
961
|
+
\end_layout
|
962
|
+
|
963
|
+
\begin_layout Standard
|
964
|
+
resample – resamples the recording
|
965
|
+
\end_layout
|
966
|
+
|
967
|
+
\begin_layout Standard
|
968
|
+
series – returns the data series for the specified features
|
969
|
+
\end_layout
|
970
|
+
|
971
|
+
\begin_layout Standard
|
972
|
+
timed? – whether the dataset type is timed
|
973
|
+
\end_layout
|
974
|
+
|
975
|
+
\begin_layout Standard
|
976
|
+
reconstruct( event:, **settings ) – reconstructs a simulation instance for
|
977
|
+
a given key
|
978
|
+
\end_layout
|
979
|
+
|
980
|
+
\begin_layout Subsection*
|
981
|
+
|
982
|
+
\family typewriter
|
983
|
+
YPetri::World
|
984
|
+
\family default
|
985
|
+
and
|
986
|
+
\family typewriter
|
987
|
+
YPetri::Agent
|
988
|
+
\family default
|
989
|
+
class
|
990
|
+
\end_layout
|
991
|
+
|
992
|
+
\begin_layout Standard
|
993
|
+
|
994
|
+
\family typewriter
|
995
|
+
YPetri::World
|
996
|
+
\family default
|
997
|
+
is the object space where places, transitions, and nets live.
|
998
|
+
(Originally, this class was named
|
999
|
+
\family typewriter
|
1000
|
+
Workspace
|
1001
|
+
\family default
|
1002
|
+
, but
|
1003
|
+
\family typewriter
|
1004
|
+
World
|
1005
|
+
\family default
|
1006
|
+
is shorter.) As for
|
1007
|
+
\family typewriter
|
1008
|
+
YPetri::Agent
|
1009
|
+
\family default
|
1010
|
+
class, it represents the user and acts as user proxy to
|
1011
|
+
\family typewriter
|
1012
|
+
YPetri::World
|
1013
|
+
\family default
|
1014
|
+
instance.
|
1015
|
+
|
1016
|
+
\family typewriter
|
1017
|
+
YPetri::Agent
|
1018
|
+
\family default
|
1019
|
+
does not encapsulate
|
1020
|
+
\family typewriter
|
1021
|
+
YPetri
|
1022
|
+
\family default
|
1023
|
+
as completely, as the Law of Demeter might require, but it does one very
|
1024
|
+
useful thing: It defines the top-level DSL commands (methods) that are
|
1025
|
+
available upon calling '
|
1026
|
+
\family typewriter
|
1027
|
+
include YPetri
|
1028
|
+
\family default
|
1029
|
+
' or '
|
1030
|
+
\family typewriter
|
1031
|
+
include YNelson
|
1032
|
+
\family default
|
1033
|
+
'.
|
1034
|
+
\end_layout
|
1035
|
+
|
1036
|
+
\end_body
|
1037
|
+
\end_document
|