y_petri 2.1.3 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/y_petri/agent/petri_net_related.rb +25 -5
  3. data/lib/y_petri/agent/selection.rb +12 -10
  4. data/lib/y_petri/agent/simulation_related.rb +14 -58
  5. data/lib/y_petri/agent.rb +15 -17
  6. data/lib/y_petri/core/timed/euler.rb +13 -15
  7. data/lib/y_petri/core/timed/pseudo_euler.rb +22 -24
  8. data/lib/y_petri/core/timed/quasi_euler.rb +15 -17
  9. data/lib/y_petri/core/timed.rb +42 -44
  10. data/lib/y_petri/core/timeless/pseudo_euler.rb +12 -14
  11. data/lib/y_petri/core/timeless.rb +10 -7
  12. data/lib/y_petri/core.rb +3 -3
  13. data/lib/y_petri/dsl.rb +46 -46
  14. data/lib/y_petri/fixed_assets.rb +8 -0
  15. data/lib/y_petri/net/data_set.rb +238 -0
  16. data/lib/y_petri/net/own_state.rb +63 -0
  17. data/lib/y_petri/net/state/feature/delta.rb +98 -71
  18. data/lib/y_petri/net/state/feature/firing.rb +51 -54
  19. data/lib/y_petri/net/state/feature/flux.rb +51 -55
  20. data/lib/y_petri/net/state/feature/gradient.rb +55 -59
  21. data/lib/y_petri/net/state/feature/marking.rb +55 -59
  22. data/lib/y_petri/net/state/feature.rb +65 -67
  23. data/lib/y_petri/net/state/features/record.rb +150 -43
  24. data/lib/y_petri/net/state/features.rb +252 -96
  25. data/lib/y_petri/net/state.rb +114 -106
  26. data/lib/y_petri/net/visualization.rb +3 -2
  27. data/lib/y_petri/net.rb +29 -24
  28. data/lib/y_petri/place/arcs.rb +3 -3
  29. data/lib/y_petri/place/guard.rb +35 -117
  30. data/lib/y_petri/place/guarded.rb +86 -0
  31. data/lib/y_petri/place.rb +6 -3
  32. data/lib/y_petri/simulation/element_representation.rb +2 -2
  33. data/lib/y_petri/simulation/elements.rb +3 -1
  34. data/lib/y_petri/simulation/feature_set.rb +3 -1
  35. data/lib/y_petri/simulation/marking_vector.rb +3 -1
  36. data/lib/y_petri/simulation/place_mapping.rb +3 -1
  37. data/lib/y_petri/simulation/places.rb +1 -1
  38. data/lib/y_petri/simulation/recorder.rb +60 -54
  39. data/lib/y_petri/simulation/timed/recorder.rb +12 -1
  40. data/lib/y_petri/simulation/timed.rb +173 -172
  41. data/lib/y_petri/simulation/transitions/access.rb +97 -29
  42. data/lib/y_petri/simulation.rb +11 -9
  43. data/lib/y_petri/transition/{assignment.rb → A.rb} +2 -2
  44. data/lib/y_petri/transition/{timed.rb → T.rb} +2 -2
  45. data/lib/y_petri/transition/arcs.rb +3 -3
  46. data/lib/y_petri/transition/cocking.rb +3 -3
  47. data/lib/y_petri/transition/{init.rb → construction_convenience.rb} +6 -53
  48. data/lib/y_petri/transition/{ordinary_timeless.rb → t.rb} +2 -2
  49. data/lib/y_petri/transition/type.rb +103 -0
  50. data/lib/y_petri/transition/type_information.rb +103 -0
  51. data/lib/y_petri/transition/types.rb +107 -0
  52. data/lib/y_petri/transition/usable_without_world.rb +14 -0
  53. data/lib/y_petri/transition.rb +87 -101
  54. data/lib/y_petri/version.rb +1 -1
  55. data/lib/y_petri/world/dependency.rb +30 -28
  56. data/lib/y_petri/world.rb +10 -8
  57. data/test/acceptance/basic_usage_test.rb +3 -3
  58. data/test/acceptance/simulation_test.rb +3 -3
  59. data/test/acceptance/simulation_with_physical_units_test.rb +2 -2
  60. data/test/acceptance/token_game_test.rb +2 -2
  61. data/test/acceptance/visualization_test.rb +3 -3
  62. data/test/acceptance_tests.rb +2 -2
  63. data/test/agent_test.rb +1 -1
  64. data/test/net_test.rb +41 -17
  65. data/test/place_test.rb +1 -1
  66. data/test/simulation_test.rb +39 -39
  67. data/test/transition_test.rb +1 -1
  68. data/test/world_test.rb +1 -1
  69. data/test/y_petri_test.rb +1 -1
  70. metadata +13 -8
  71. data/lib/y_petri/net/state/features/dataset.rb +0 -135
  72. data/lib/y_petri/transition/construction.rb +0 -311
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b031424367891fe4ff8af4b6c61afb984f5d341
4
- data.tar.gz: adb9f8df5d999a60beff42aa1f69fa9aed7f0a7a
3
+ metadata.gz: a26f28cc30784b84af2607346f5ae43815378cc9
4
+ data.tar.gz: 7b42c3212a0763a35a59cf0880e420bbee0f1940
5
5
  SHA512:
6
- metadata.gz: ed934ecfc8a78e32d65b8174fee3eedab5ee969ae857b847698581ca3b33e002a4ead151e361caa2d14593efaf44d3d8b04b49f4c286f2a72173bd36c1314a25
7
- data.tar.gz: c4fabc8dcf91e509e249dab7e0af4afb97ec2dc8d2b93b5bd18936e408915913e96ef45eb53756b34767257dff0d842194af6a992354e68f183facbad3b05f15
6
+ metadata.gz: 78881ebf5455b9165f9fcc1545cf57523a84951e7e47721038dc5196e52912296fed36abfcb87c6cb652d6c00cf1bef83a2ab1fbc46aa7b2d5bf31943e80ef6c
7
+ data.tar.gz: 30852ad27a179bc77662c2dc1aef932299a7b4f9493cab3ab52d255f3928b794af74f904f3f60327620ddc63757f3cb6762e8af5931003e45bb03b04cc5546ea
@@ -78,15 +78,35 @@ module YPetri::Agent::PetriNetRelated
78
78
  # world. Rate closure has to be supplied as a block.
79
79
  #
80
80
  def T( *ordered, **named, &block )
81
+ fail ArgumentError, "Timed transition constructor requires a block " +
82
+ "defining the rate function!" unless block
81
83
  world.Transition.new *ordered, **named.update( rate: block )
82
84
  end
83
85
 
86
+ # Timed stoichiometric transition constructor, that expects stoichiometry
87
+ # given directly as hash-collected arguments. Two special keys allowed are
88
+ # +:name+ (alias +:ɴ) and +:domain+. (Key +:codomain+ is not allowed.)
89
+ #
90
+ def TS **stoichiometry, &block
91
+ args = { s: stoichiometry }
92
+ args.update name: stoichiometry.delete( :name ) if
93
+ stoichiometry.has? :name, syn!: :ɴn
94
+ args.update domain: stoichiometry.delete( :domain ) if
95
+ stoichiometry.has? :domain
96
+ T **args, &block
97
+ end
98
+
84
99
  # Assignment transition constructor: Creates a new assignment transition in
85
- # the current world. Assignment closure has to be supplied as a block.
86
- #
87
- def A( *ordered, **named, &block )
88
- world.Transition.new *ordered,
89
- **named.update( assignment: true, action: block )
100
+ # the current world. Ordered arguments are collected as codomain. Domain key
101
+ # (+:domain) is optional. Assignment closure must be supplied in a block.
102
+ #
103
+ def A( *codomain, **nn, &block )
104
+ fail ArgumentError, "Assignment transition constructor requires a block " +
105
+ "defining the assignment function!" unless block
106
+ world.Transition.new codomain: codomain,
107
+ assignment: true,
108
+ action: block,
109
+ **nn
90
110
  end
91
111
 
92
112
  # Net constructor: Creates a new Net instance in the current world.
@@ -1,12 +1,14 @@
1
- class YPetri::Agent::Selection
2
- # TODO: This calls for refactor as Array subclass.
3
- def initialize
4
- clear
1
+ class YPetri::Agent
2
+ class Selection
3
+ # TODO: This calls for refactor as Array subclass. No time right now...
4
+ def initialize
5
+ clear
6
+ end
7
+ def clear; @selection = [] end
8
+ def set *aa; @selection = aa end
9
+ def get; @selection end
10
+ def add arg; @selection << arg end
11
+ alias :<< :add
12
+ def subtract arg; @selection -= arg end
5
13
  end
6
- def clear; @selection = [] end
7
- def set *aa; @selection = aa end
8
- def get; @selection end
9
- def add arg; @selection << arg end
10
- alias :<< :add
11
- def subtract arg; @selection -= arg end
12
14
  end
@@ -191,7 +191,7 @@ module YPetri::Agent::SimulationRelated
191
191
  # collection).
192
192
  #
193
193
  def set_step Δt
194
- ssc.update step_size: Δt
194
+ ssc.update step: Δt
195
195
  end
196
196
  alias set_step_size set_step
197
197
 
@@ -212,7 +212,7 @@ module YPetri::Agent::SimulationRelated
212
212
  # settings collection).
213
213
  #
214
214
  def set_sampling Δt
215
- ssc.update sampling_period: Δt
215
+ ssc.update sampling: Δt
216
216
  end
217
217
 
218
218
  # Changes the simulation method of the current ssc (ssc = simulation
@@ -258,11 +258,8 @@ module YPetri::Agent::SimulationRelated
258
258
  # --> delta feature ids
259
259
  # --> flux feature ids
260
260
  # --> firing feature ids
261
-
262
261
  # take these features together
263
-
264
262
  # construct the labels and the time series for each
265
-
266
263
  # plot them
267
264
 
268
265
  return nil unless sim = world.simulations.values[-1] # sim@point
@@ -287,63 +284,22 @@ module YPetri::Agent::SimulationRelated
287
284
  #
288
285
  def plot_state( place_ids=nil, except: [] )
289
286
  sim = simulation or return nil
290
- feat = sim.pp( place_ids || sim.pp ) - sim.pp( Array except )
291
- gnuplot sim.record.marking( feat ), time: sim.target_time,
292
- title: "State plot", ylabel: "Marking"
287
+ rec = sim.recording
288
+ pp = sim.net.pp( place_ids.nil? ? net.pp : place_ids ) -
289
+ sim.net.pp( except )
290
+ dataset = sim.recording.reduce_features( marking: pp )
291
+ dataset.plot
293
292
  end
294
293
  alias plot_marking plot_state
295
294
 
296
295
  # Plot the recorded flux (computed flux history at the sampling points).
297
296
  #
298
- def plot_flux( transition_ids=nil, **options )
299
- sim = world.simulations.values[-1] or return nil # sim@point
300
- tt = sim.TS_transitions( transition_ids ).sources
301
- excluded = sim.transitions( Array options[:except] ).sources
302
- tt -= excluded
303
- flux = sim.recording.modify do |time, record|
304
- [ time,
305
- sim.at( time: time, marking: record ).TS_transitions( tt ).flux_vector ]
306
- end
307
- # Select a time series for each feature.
308
- time_series = tt.map.with_index do |tr, i|
309
- tr and flux.map { |time, flux| [ time, flux[i] ] }.transpose
310
- end
311
- # Time axis
312
- time = sim.target_time
313
- # Gnuplot call
314
- gnuplot( time, tt.compact.names, time_series.compact,
315
- title: "Flux plot", ylabel: "Flux [µMⁿ.s⁻¹]" )
316
- end
317
-
318
- private
319
-
320
- # Gnuplots a recording. Target time or time range can be supplied as :time
321
- # named argument.
322
- #
323
- def gnuplot( dataset, time: nil, **nn )
324
- event_vector = dataset.events
325
- data_vectors = dataset.values.transpose
326
- x_range = if time.is_a? Range then
327
- "[#{time.begin}:#{time.end}]"
328
- else
329
- "[-0:#{SY::Time.magnitude( time ).amount rescue time}]"
330
- end
331
- labels = recording.features.labels
332
-
333
- Gnuplot.open do |gp|
334
- Gnuplot::Plot.new( gp ) do |plot|
335
- plot.xrange x_range
336
- plot.title nn[:title] || "Simulation plot"
337
- plot.ylabel nn[:ylabel] || "Values"
338
- plot.xlabel nn[:xlabel] || "Time [s]"
339
-
340
- labels.zip( data_vectors ).each { |label, data_vector|
341
- plot.data << Gnuplot::DataSet.new( [event_vector, data_vector] ) { |ds|
342
- ds.with = "linespoints"
343
- ds.title = lbl
344
- }
345
- }
346
- end
347
- end
297
+ def plot_flux( transition_ids=nil, except: [], **options )
298
+ sim = simulation or return nil
299
+ rec = sim.recording
300
+ tt = sim.net.tt( transition_ids.nil? ? net.tt : transition_ids ) -
301
+ sim.net.tt( except )
302
+ dataset = sim.recording.reduce_features( flux: tt )
303
+ dataset.plot( title: "Flux plot", ylabel: "Flux [µMⁿ.s⁻¹]" )
348
304
  end
349
305
  end # module YPetri::Agent::SimulationRelated
data/lib/y_petri/agent.rb CHANGED
@@ -1,22 +1,20 @@
1
- #encoding: utf-8
1
+ # encoding: utf-8
2
+
3
+ require_relative 'agent/selection'
4
+ require_relative 'agent/hash_key_pointer'
5
+ require_relative 'agent/petri_net_related'
6
+ require_relative 'agent/simulation_related'
2
7
 
3
8
  # Public command interface of YPetri.
4
9
  #
5
- module YPetri
6
- class Agent
7
- attr_reader :world
8
-
9
- def initialize
10
- @world = YPetri::World.new
11
- super
12
- end
10
+ class YPetri::Agent
11
+ PetriNetRelated # ★ means include
12
+ SimulationRelated
13
13
 
14
- require_relative 'agent/selection'
15
- require_relative 'agent/hash_key_pointer'
16
- require_relative 'agent/petri_net_related'
17
- require_relative 'agent/simulation_related'
14
+ attr_reader :world
18
15
 
19
- include self::PetriNetRelated
20
- include self::SimulationRelated
21
- end # class Agent
22
- end # module YPetri
16
+ def initialize
17
+ @world = YPetri::World.new
18
+ super
19
+ end
20
+ end # module YPetri::Agent
@@ -2,19 +2,17 @@
2
2
 
3
3
  # Euler method.
4
4
  #
5
- class YPetri::Core::Timed
6
- module Euler
7
- # Name of this method.
8
- #
9
- def simulation_method
10
- :euler
11
- end
5
+ module YPetri::Core::Timed::Euler
6
+ # Name of this method.
7
+ #
8
+ def simulation_method
9
+ :euler
10
+ end
12
11
 
13
- # Computes Δ for the period of Δt.
14
- #
15
- def delta Δt
16
- gradient * Δt
17
- end
18
- alias Δ delta
19
- end # Euler
20
- end # YPetri::Core::Timed
12
+ # Computes Δ for the period of Δt.
13
+ #
14
+ def delta Δt
15
+ gradient * Δt
16
+ end
17
+ alias Δ delta
18
+ end # YPetri::Core::Timed::Euler
@@ -2,30 +2,28 @@
2
2
 
3
3
  # Euler method with timeless transitions firing after each step.
4
4
  #
5
- class YPetri::Core::Timed
6
- module PseudoEuler
7
- include Euler
5
+ module YPetri::Core::Timed::PseudoEuler
6
+ include YPetri::Core::Timed::Euler
8
7
 
9
- # Name of this method.
10
- #
11
- def simulation_method
12
- :pseudo_euler
13
- end
8
+ # Name of this method.
9
+ #
10
+ def simulation_method
11
+ :pseudo_euler
12
+ end
14
13
 
15
- # Computes Δ for the period of Δt.
16
- #
17
- def delta Δt
18
- super + delta_timeless
19
- end
20
- alias Δ delta
14
+ # Computes Δ for the period of Δt.
15
+ #
16
+ def delta Δt
17
+ super + delta_timeless
18
+ end
19
+ alias Δ delta
21
20
 
22
- # Makes a single step by Δt.
23
- #
24
- def step! Δt=simulation.step
25
- increment_marking_vector Δ( Δt )
26
- assignment_transitions_all_fire!
27
- simulation.increment_time! Δt
28
- alert
29
- end
30
- end # PseudoEuler
31
- end # YPetri::Core::Timed
21
+ # Makes a single step by Δt.
22
+ #
23
+ def step! Δt=simulation.step
24
+ increment_marking_vector Δ( Δt )
25
+ assignment_transitions_all_fire!
26
+ simulation.increment_time! Δt
27
+ alert
28
+ end
29
+ end # YPetri::Core::Timed::PseudoEuler
@@ -2,22 +2,20 @@
2
2
 
3
3
  # Euler method with timeless transitions firing every time tick.
4
4
  #
5
- class YPetri::Core::Timed
6
- module QuasiEuler
7
- include Euler
5
+ module YPetri::Core::Timed::QuasiEuler
6
+ include YPetri::Core::Timed::Euler
8
7
 
9
- # Name of this method.
10
- #
11
- def simulation_method
12
- :quasi_euler
13
- end
8
+ # Name of this method.
9
+ #
10
+ def simulation_method
11
+ :quasi_euler
12
+ end
14
13
 
15
- # Makes a single step by Δt.
16
- #
17
- def step! Δt=simulation.step_size
18
- fail NotImplementedError
19
- # Now one would have to compare whichever comes first, time tick or the
20
- # end of Δt, and then again and again, until Δt is fired...
21
- end
22
- end # QuasiEuler
23
- end # YPetri::Core::Timed
14
+ # Makes a single step by Δt.
15
+ #
16
+ def step! Δt=simulation.step_size
17
+ fail NotImplementedError
18
+ # Now one would have to compare whichever comes first, time tick or the
19
+ # end of Δt, and then again and again, until Δt is fired...
20
+ end
21
+ end # YPetri::Core::Timed::QuasiEuler
@@ -2,56 +2,54 @@
2
2
 
3
3
  # Timed simulation core.
4
4
  #
5
- class YPetri::Core
6
- class Timed < YPetri::Core
7
- require_relative 'timed/euler.rb'
8
- require_relative 'timed/pseudo_euler.rb' # timeless fire after each step
9
- require_relative 'timed/quasi_euler.rb' # timeless fire each time tick
5
+ class YPetri::Core::Timed < YPetri::Core
6
+ require_relative 'timed/euler.rb'
7
+ require_relative 'timed/pseudo_euler.rb' # timeless fire after each step
8
+ require_relative 'timed/quasi_euler.rb' # timeless fire each time tick
10
9
 
11
- # Makes a single step by Δt.
12
- #
13
- def step! Δt=simulation.step
14
- increment_marking_vector Δ( Δt )
15
- increment_time! Δt
16
- note_state_change
17
- end
10
+ # Makes a single step by Δt.
11
+ #
12
+ def step! Δt=simulation.step
13
+ increment_marking_vector Δ( Δt )
14
+ increment_time! Δt
15
+ note_state_change
16
+ end
18
17
 
19
- # Gradient for free places.
20
- #
21
- def gradient
22
- gradient_Ts + gradient_TS
23
- end
24
- alias ∇ gradient
18
+ # Gradient for free places.
19
+ #
20
+ def gradient
21
+ gradient_Ts + gradient_TS
22
+ end
23
+ alias ∇ gradient
25
24
 
26
- # Gradient contribution by Ts transitions.
27
- #
28
- def gradient_Ts
29
- simulation.Ts_gradient_closure.call
30
- end
25
+ # Gradient contribution by Ts transitions.
26
+ #
27
+ def gradient_Ts
28
+ simulation.Ts_gradient_closure.call
29
+ end
31
30
 
32
- # Gradient contribution by TS transitions.
33
- #
34
- def gradient_TS
35
- ( simulation.TS_stoichiometry_matrix * flux_vector_TS )
36
- end
31
+ # Gradient contribution by TS transitions.
32
+ #
33
+ def gradient_TS
34
+ ( simulation.TS_stoichiometry_matrix * flux_vector_TS )
35
+ end
37
36
 
38
- # Flux vector. The caller asserts that all the timed transitions are
39
- # stoichiometric, or error.
40
- #
41
- def flux_vector
42
- msg = "#flux_vector method only applies to the timed simulations with " +
43
- "no Ts transitions. Try #flux_vector_TS instead!"
44
- fail msg unless Ts_transitions().empty?
45
- simulation.TS_rate_closure.call
46
- end
37
+ # Flux vector. The caller asserts that all the timed transitions are
38
+ # stoichiometric, or error.
39
+ #
40
+ def flux_vector
41
+ msg = "#flux_vector method only applies to the timed simulations with " +
42
+ "no Ts transitions. Try #flux_vector_TS instead!"
43
+ fail msg unless Ts_transitions().empty?
44
+ simulation.TS_rate_closure.call
45
+ end
47
46
 
48
- # Flux vector of TS transitions.
49
- #
50
- def flux_vector_TS
51
- simulation.TS_rate_closure.call
52
- end
53
- end # class Timed
54
- end # class YPetri::Core
47
+ # Flux vector of TS transitions.
48
+ #
49
+ def flux_vector_TS
50
+ simulation.TS_rate_closure.call
51
+ end
52
+ end # class YPetri::Core::Timed
55
53
 
56
54
  # In general, it is not required that all net elements are simulated with the
57
55
  # same method. Practically, ODE systems have many good simulation methods
@@ -3,18 +3,16 @@
3
3
  # Implicit Euler for timeless nets. Simply, timeless transitions
4
4
  # fire simultaneously, after which A transitions (if any) fire.
5
5
  #
6
- class YPetri::Core::Timeless
7
- module PseudoEuler
8
- # Name of this method.
9
- #
10
- def simulation_method
11
- :pseudo_euler
12
- end
6
+ module YPetri::Core::Timeless::PseudoEuler
7
+ # Name of this method.
8
+ #
9
+ def simulation_method
10
+ :pseudo_euler
11
+ end
13
12
 
14
- def step!
15
- increment_marking_vector Δ
16
- assignment_transitions_all_fire!
17
- alert
18
- end
19
- end # module PseudoEuler
20
- end # class YPetri::Core::Timeless
13
+ def step!
14
+ increment_marking_vector Δ
15
+ assignment_transitions_all_fire!
16
+ alert
17
+ end
18
+ end # module YPetri::Core::Timeless::PseudoEuler
@@ -2,11 +2,14 @@
2
2
 
3
3
  # Timeless simulation core.
4
4
  #
5
- class YPetri::Core
6
- class Timeless < YPetri::Core
7
- require_relative 'timeless/pseudo_euler'
5
+ class YPetri::Core::Timeless < YPetri::Core
6
+ require_relative 'timeless/pseudo_euler'
8
7
 
9
- alias delta delta_timeless
10
- alias Δ delta
11
- end # class Timeless
12
- end # class YPetri::Core
8
+ def delta
9
+ delta_timeless
10
+ end
11
+
12
+ def Δ
13
+ delta
14
+ end
15
+ end # class YPetri::Core::Timeless
data/lib/y_petri/core.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require_relative 'core/timed'
4
+ require_relative 'core/timeless'
5
+
3
6
  class YPetri::Core
4
7
  DEFAULT_METHOD = :pseudo_euler
5
8
 
@@ -95,6 +98,3 @@ class YPetri::Core
95
98
  simulation.A_assignment_closure.call
96
99
  end
97
100
  end # class YPetri::Core
98
-
99
- require_relative 'core/timed'
100
- require_relative 'core/timeless'
data/lib/y_petri/dsl.rb CHANGED
@@ -11,54 +11,54 @@ module YPetri
11
11
  delegate :world, to: :y_petri_agent
12
12
 
13
13
  # Petri net aspect.
14
- delegate( :Place,
15
- :Transition, :T, :A,
16
- :Net,
17
- :place, :transition, :pl, :tr,
18
- :places, :transitions, :nets,
19
- :pn, :tn, :nn,
20
- :net_point,
21
- :net_selection,
22
- :net, :nnet,
23
- :net_point_reset,
24
- :net_point=,
25
- to: :y_petri_agent )
14
+ delegate :Place,
15
+ :Transition, :T, :A,
16
+ :Net,
17
+ :place, :transition, :pl, :tr,
18
+ :places, :transitions, :nets,
19
+ :pn, :tn, :nn,
20
+ :net_point,
21
+ :net_selection,
22
+ :net, :nnet,
23
+ :net_point_reset,
24
+ :net_point=,
25
+ to: :y_petri_agent
26
26
 
27
27
  # Simulation aspect.
28
- delegate( :simulation_point, :ssc_point, :cc_point, :imc_point,
29
- :simulation_selection, :ssc_selection,
30
- :cc_selection, :imc_selection,
31
- :simulations,
32
- :clamp_collections,
33
- :initial_marking_collections,
34
- :simulation_settings_collections,
35
- :clamp_collection_names, :ncc,
36
- :initial_marking_collection_names, :nimc,
37
- :simulation_settings_collection_names, :nssc,
38
- :set_clamp_collection, :set_cc,
39
- :set_initial_marking_collection, :set_imc,
40
- :set_simulation_settings_collection, :set_ssc,
41
- :new_simulation,
42
- :clamp_cc, :initial_marking_cc, :simulation_settings_cc,
43
- :simulation_point_position,
44
- :simulation,
45
- :clamp_collection, :cc,
46
- :initial_marking_collection, :imc,
47
- :simulation_settings_collection, :ssc,
48
- :clamp,
49
- :initial_marking,
50
- :set_step, :set_step_size,
51
- :set_time, :set_target_time,
52
- :set_sampling,
53
- :set_simulation_method,
54
- :new_timed_simulation,
55
- :run!,
56
- :print_recording,
57
- :plot,
58
- :plot_selected,
59
- # :plot_state,
60
- :plot_flux,
61
- to: :y_petri_agent )
28
+ delegate :simulation_point, :ssc_point, :cc_point, :imc_point,
29
+ :simulation_selection, :ssc_selection,
30
+ :cc_selection, :imc_selection,
31
+ :simulations,
32
+ :clamp_collections,
33
+ :initial_marking_collections,
34
+ :simulation_settings_collections,
35
+ :clamp_collection_names, :ncc,
36
+ :initial_marking_collection_names, :nimc,
37
+ :simulation_settings_collection_names, :nssc,
38
+ :set_clamp_collection, :set_cc,
39
+ :set_initial_marking_collection, :set_imc,
40
+ :set_simulation_settings_collection, :set_ssc,
41
+ :new_simulation,
42
+ :clamp_cc, :initial_marking_cc, :simulation_settings_cc,
43
+ :simulation_point_position,
44
+ :simulation,
45
+ :clamp_collection, :cc,
46
+ :initial_marking_collection, :imc,
47
+ :simulation_settings_collection, :ssc,
48
+ :clamp,
49
+ :initial_marking,
50
+ :set_step, :set_step_size,
51
+ :set_time, :set_target_time,
52
+ :set_sampling,
53
+ :set_simulation_method,
54
+ :new_timed_simulation,
55
+ :run!,
56
+ :print_recording,
57
+ :plot,
58
+ :plot_selected,
59
+ # :plot_state,
60
+ :plot_flux,
61
+ to: :y_petri_agent
62
62
 
63
63
  def plot_state **nn
64
64
  simulation.recording.marking.plot **nn
@@ -4,4 +4,12 @@
4
4
  #
5
5
  module YPetri
6
6
  GuardError = Class.new TypeError
7
+
8
+ Place = Class.new
9
+ Transition = Class.new
10
+ Net = Class.new
11
+ Simulation = Class.new
12
+ Core = Class.new
13
+ World = Class.new
14
+ Agent = Class.new
7
15
  end # module YPetri