y_petri 2.1.3 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/y_petri/agent/petri_net_related.rb +25 -5
- data/lib/y_petri/agent/selection.rb +12 -10
- data/lib/y_petri/agent/simulation_related.rb +14 -58
- data/lib/y_petri/agent.rb +15 -17
- data/lib/y_petri/core/timed/euler.rb +13 -15
- data/lib/y_petri/core/timed/pseudo_euler.rb +22 -24
- data/lib/y_petri/core/timed/quasi_euler.rb +15 -17
- data/lib/y_petri/core/timed.rb +42 -44
- data/lib/y_petri/core/timeless/pseudo_euler.rb +12 -14
- data/lib/y_petri/core/timeless.rb +10 -7
- data/lib/y_petri/core.rb +3 -3
- data/lib/y_petri/dsl.rb +46 -46
- data/lib/y_petri/fixed_assets.rb +8 -0
- data/lib/y_petri/net/data_set.rb +238 -0
- data/lib/y_petri/net/own_state.rb +63 -0
- data/lib/y_petri/net/state/feature/delta.rb +98 -71
- data/lib/y_petri/net/state/feature/firing.rb +51 -54
- data/lib/y_petri/net/state/feature/flux.rb +51 -55
- data/lib/y_petri/net/state/feature/gradient.rb +55 -59
- data/lib/y_petri/net/state/feature/marking.rb +55 -59
- data/lib/y_petri/net/state/feature.rb +65 -67
- data/lib/y_petri/net/state/features/record.rb +150 -43
- data/lib/y_petri/net/state/features.rb +252 -96
- data/lib/y_petri/net/state.rb +114 -106
- data/lib/y_petri/net/visualization.rb +3 -2
- data/lib/y_petri/net.rb +29 -24
- data/lib/y_petri/place/arcs.rb +3 -3
- data/lib/y_petri/place/guard.rb +35 -117
- data/lib/y_petri/place/guarded.rb +86 -0
- data/lib/y_petri/place.rb +6 -3
- data/lib/y_petri/simulation/element_representation.rb +2 -2
- data/lib/y_petri/simulation/elements.rb +3 -1
- data/lib/y_petri/simulation/feature_set.rb +3 -1
- data/lib/y_petri/simulation/marking_vector.rb +3 -1
- data/lib/y_petri/simulation/place_mapping.rb +3 -1
- data/lib/y_petri/simulation/places.rb +1 -1
- data/lib/y_petri/simulation/recorder.rb +60 -54
- data/lib/y_petri/simulation/timed/recorder.rb +12 -1
- data/lib/y_petri/simulation/timed.rb +173 -172
- data/lib/y_petri/simulation/transitions/access.rb +97 -29
- data/lib/y_petri/simulation.rb +11 -9
- data/lib/y_petri/transition/{assignment.rb → A.rb} +2 -2
- data/lib/y_petri/transition/{timed.rb → T.rb} +2 -2
- data/lib/y_petri/transition/arcs.rb +3 -3
- data/lib/y_petri/transition/cocking.rb +3 -3
- data/lib/y_petri/transition/{init.rb → construction_convenience.rb} +6 -53
- data/lib/y_petri/transition/{ordinary_timeless.rb → t.rb} +2 -2
- data/lib/y_petri/transition/type.rb +103 -0
- data/lib/y_petri/transition/type_information.rb +103 -0
- data/lib/y_petri/transition/types.rb +107 -0
- data/lib/y_petri/transition/usable_without_world.rb +14 -0
- data/lib/y_petri/transition.rb +87 -101
- data/lib/y_petri/version.rb +1 -1
- data/lib/y_petri/world/dependency.rb +30 -28
- data/lib/y_petri/world.rb +10 -8
- data/test/acceptance/basic_usage_test.rb +3 -3
- data/test/acceptance/simulation_test.rb +3 -3
- data/test/acceptance/simulation_with_physical_units_test.rb +2 -2
- data/test/acceptance/token_game_test.rb +2 -2
- data/test/acceptance/visualization_test.rb +3 -3
- data/test/acceptance_tests.rb +2 -2
- data/test/agent_test.rb +1 -1
- data/test/net_test.rb +41 -17
- data/test/place_test.rb +1 -1
- data/test/simulation_test.rb +39 -39
- data/test/transition_test.rb +1 -1
- data/test/world_test.rb +1 -1
- data/test/y_petri_test.rb +1 -1
- metadata +13 -8
- data/lib/y_petri/net/state/features/dataset.rb +0 -135
- data/lib/y_petri/transition/construction.rb +0 -311
data/test/net_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#! /usr/bin/ruby
|
2
2
|
# encoding: utf-8
|
3
3
|
|
4
|
-
|
4
|
+
gem 'minitest', '=4.7.4'
|
5
5
|
require 'minitest/autorun'
|
6
6
|
require_relative '../lib/y_petri' # tested component itself
|
7
7
|
# require 'y_petri'
|
@@ -26,7 +26,7 @@ describe YPetri::Net do
|
|
26
26
|
@net = @w.Net.new
|
27
27
|
end
|
28
28
|
|
29
|
-
it "should
|
29
|
+
it "should be able to include places" do
|
30
30
|
p = @w.Place.new name: "A", quantum: 0.1, marking: 1.1
|
31
31
|
@net.includes_place?( p ).must_equal false
|
32
32
|
@net.include_place p
|
@@ -47,9 +47,6 @@ describe YPetri::Net do
|
|
47
47
|
|
48
48
|
describe "net of 3 places and no transitions" do
|
49
49
|
before do
|
50
|
-
# @p1.m = 1.1
|
51
|
-
# @p2.m = 2.2
|
52
|
-
# @p3.m = 3.3
|
53
50
|
@net = @w.Net.of @p1, @p2, @p3
|
54
51
|
end
|
55
52
|
|
@@ -59,27 +56,34 @@ describe YPetri::Net do
|
|
59
56
|
assert_equal [], @net.transitions
|
60
57
|
end
|
61
58
|
|
62
|
-
it "should
|
59
|
+
it "should allow only right transitions to be included in it" do
|
60
|
+
assert @net.include?( @p1 )
|
61
|
+
assert ! @net.include?( @p4 )
|
62
|
+
t = @w.Transition.new s: { @p4 => -1 }
|
63
|
+
-> { @net.include_transition t }.must_raise RuntimeError
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should expose (thus far empty) transition groups" do
|
63
67
|
assert_equal [], @net.S_transitions
|
64
68
|
assert_equal [], @net.s_transitions
|
65
69
|
end
|
66
70
|
|
67
|
-
it "should tell its qualities" do
|
68
|
-
assert_equal
|
71
|
+
it "should be able to tell its qualities" do
|
72
|
+
assert_equal false, @net.functional?
|
69
73
|
assert_equal false, @net.timed?
|
70
74
|
assert @net.include?( @p1 ) && !@net.include?( YPetri::Place.new )
|
71
75
|
end
|
72
76
|
|
73
|
-
it "should
|
77
|
+
it "should know its state and marking features" do
|
78
|
+
@net.state.must_equal [ @p1, @p2, @p3 ].map( &:marking )
|
79
|
+
@net.state.must_be_kind_of YPetri::Net::State
|
80
|
+
@net.marking.must_equal [ @p1, @p2, @p3 ].map( &:marking )
|
81
|
+
@net.marking.must_be_kind_of Array
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should have standard equipment of a class" do
|
74
85
|
assert @net == @net.dup
|
75
86
|
assert @net.inspect.start_with? "#<Net:"
|
76
|
-
assert @net.include?( @p1 )
|
77
|
-
assert ! @net.include?( @p_not_included )
|
78
|
-
begin
|
79
|
-
@net.exclude_place! @p_not_included
|
80
|
-
@net.include_transition! YPetri::Transition.new( s: { @p_not_included => -1 } )
|
81
|
-
flunk "Attempt to include illegal transition fails to raise"
|
82
|
-
rescue; end
|
83
87
|
end
|
84
88
|
|
85
89
|
describe "plus 1 stoichio. transition with rate" do
|
@@ -123,6 +127,11 @@ describe YPetri::Net do
|
|
123
127
|
@net.must_respond_to :simulation
|
124
128
|
end
|
125
129
|
|
130
|
+
it "should know right flux, firing, gradient and delta features" do
|
131
|
+
@net.firing( [] ).must_equal []
|
132
|
+
-> { @net.firing }.must_raise TypeError
|
133
|
+
end
|
134
|
+
|
126
135
|
it "should have other methods" do
|
127
136
|
assert_equal [1.1, 2.2, 3.3], [@p1, @p2, @p3].map( &:marking ).map{ |n| n.round 6 }
|
128
137
|
assert_equal 2.2 * 3.3 * 0.01, @t1.rate_closure.call( @p2.marking, @p3.marking )
|
@@ -164,7 +173,7 @@ describe YPetri::Net do
|
|
164
173
|
end
|
165
174
|
|
166
175
|
it "should tell its qualities" do
|
167
|
-
assert_equal
|
176
|
+
assert_equal true, @net.functional?
|
168
177
|
assert_equal true, @net.timed?
|
169
178
|
@net.exclude_transition @t2
|
170
179
|
assert_equal true, @net.functional?
|
@@ -175,3 +184,18 @@ describe YPetri::Net do
|
|
175
184
|
end
|
176
185
|
end
|
177
186
|
end
|
187
|
+
|
188
|
+
|
189
|
+
describe YPetri::Net::State do
|
190
|
+
before do
|
191
|
+
@w = YPetri::World.new
|
192
|
+
@net = @w.Net.new
|
193
|
+
end
|
194
|
+
|
195
|
+
it "should be already parametrized on @w.Net" do
|
196
|
+
@St = @net.State
|
197
|
+
@St.net.must_equal @net
|
198
|
+
assert @St.Feature < YPetri::Net::State::Feature
|
199
|
+
-> { @St.feature( marking: :A ) }.must_raise NameError
|
200
|
+
end
|
201
|
+
end
|
data/test/place_test.rb
CHANGED
data/test/simulation_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#! /usr/bin/ruby
|
2
2
|
# encoding: utf-8
|
3
3
|
|
4
|
-
|
4
|
+
gem 'minitest', '=4.7.4'
|
5
5
|
require 'minitest/autorun'
|
6
6
|
require_relative '../lib/y_petri' # tested component itself
|
7
7
|
# require 'y_petri'
|
@@ -227,8 +227,9 @@ describe YPetri::Simulation do
|
|
227
227
|
end
|
228
228
|
|
229
229
|
it "should behave" do
|
230
|
-
@sim.recording.must_be_kind_of YPetri::Net::
|
231
|
-
@sim.recording
|
230
|
+
@sim.recording.must_be_kind_of YPetri::Net::DataSet
|
231
|
+
@sim.recording
|
232
|
+
.must_equal @net.State.marking.new_dataset.update( 0.0 => [1, 2] )
|
232
233
|
@sim.recording.must_equal( { 0.0 => [1, 2] } )
|
233
234
|
@sim.step! 1
|
234
235
|
@sim.recording.must_equal( { 0.0 => [1, 2], 1.0 => [2, 1] } )
|
@@ -252,7 +253,7 @@ describe YPetri::Simulation do
|
|
252
253
|
end
|
253
254
|
|
254
255
|
|
255
|
-
describe
|
256
|
+
describe "timeless simulation" do
|
256
257
|
before do
|
257
258
|
self.class.class_exec { include YPetri }
|
258
259
|
U = Place m!: 2.5
|
@@ -265,38 +266,42 @@ describe YPetri::Simulation do
|
|
265
266
|
end
|
266
267
|
|
267
268
|
it "should behave" do
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
269
|
+
s = simulation
|
270
|
+
assert ! s.timed?
|
271
|
+
s.core.must_be_kind_of YPetri::Core::Timeless::PseudoEuler
|
272
|
+
ds = s.recording
|
273
|
+
ds.size.must_equal 6
|
274
|
+
ds.events.must_equal [0, 1, 2, 3, 4, 5]
|
275
|
+
ds.interpolate( 1 )
|
276
|
+
.must_equal [2.5, 3.5]
|
277
|
+
ds.interpolate( 2 )
|
278
|
+
.must_equal [2.5, 4.5]
|
279
|
+
-> { ds.interpolate( 1.5 ) }.must_raise TypeError
|
280
|
+
ds.reconstruct( event: 2 )
|
281
|
+
.pm.must_equal( { U: 2.5, V: 4.5 } )
|
282
|
+
ds.marking.slice( 2..4 ).series
|
283
|
+
.must_equal [[2.5, 2.5, 2.5], [4.5, 5.5, 6.5]]
|
284
|
+
ds.marking.slice( 2..4 )
|
285
|
+
.must_equal( { 2 => [2.5, 4.5],
|
286
|
+
3 => [2.5, 5.5],
|
287
|
+
4 => [2.5, 6.5] } )
|
288
|
+
ds.firing.slice( 1..2 ).series
|
289
|
+
.must_equal [[1, 1]]
|
290
|
+
ds.series( firing: [:U2V] )
|
291
|
+
.must_equal [[1, 1, 1, 1, 1, 1]]
|
292
|
+
ds.delta( [:U], transitions: [:Uplus] ).series
|
293
|
+
.must_equal [[1.0, 1.0, 1.0, 1.0, 1.0, 1.0]]
|
294
|
+
tmp = ds.reduce_features( marking: [:U], firing: [:U2V] )
|
295
|
+
tmp.features
|
296
|
+
.must_equal( ds.net.State.features marking: [:U], firing: [:U2V] )
|
297
|
+
tmp.must_equal( { 0 => [2.5, 1], 1 => [2.5, 1], 2 => [2.5, 1],
|
298
|
+
3 => [2.5, 1], 4 => [2.5, 1], 5 => [2.5, 1] } )
|
293
299
|
end
|
294
300
|
end
|
295
301
|
|
296
302
|
|
297
|
-
describe
|
303
|
+
describe "timed simulation" do
|
298
304
|
before do
|
299
|
-
skip
|
300
305
|
self.class.class_exec { include YPetri }
|
301
306
|
A = Place m!: 0.5
|
302
307
|
B = Place m!: 0.5
|
@@ -339,15 +344,10 @@ describe YPetri::Simulation::Timed do
|
|
339
344
|
.must_equal []
|
340
345
|
s.recording.firing
|
341
346
|
.must_equal( [*0..12].map { |n| n * 5.0 } >> [[]] * 13 )
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
# I'll comment it out for a while to see what the plot is doing.
|
347
|
-
=begin
|
348
|
-
s.recording.delta( [:A], transitions: [:A_pump] )
|
347
|
+
s.recording
|
348
|
+
.delta( [:A], transitions: [:A_pump], delta_time: 0.1 )
|
349
|
+
.series
|
349
350
|
.must_equal [ [ -0.0005 ] * 13 ]
|
350
|
-
=end
|
351
351
|
plot_state
|
352
352
|
sleep 5
|
353
353
|
end
|
data/test/transition_test.rb
CHANGED
data/test/world_test.rb
CHANGED
data/test/y_petri_test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: y_petri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- boris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: y_support
|
@@ -80,7 +80,9 @@ files:
|
|
80
80
|
- lib/y_petri/dsl.rb
|
81
81
|
- lib/y_petri/fixed_assets.rb
|
82
82
|
- lib/y_petri/net.rb
|
83
|
+
- lib/y_petri/net/data_set.rb
|
83
84
|
- lib/y_petri/net/element_access.rb
|
85
|
+
- lib/y_petri/net/own_state.rb
|
84
86
|
- lib/y_petri/net/state.rb
|
85
87
|
- lib/y_petri/net/state/feature.rb
|
86
88
|
- lib/y_petri/net/state/feature/delta.rb
|
@@ -89,13 +91,13 @@ files:
|
|
89
91
|
- lib/y_petri/net/state/feature/gradient.rb
|
90
92
|
- lib/y_petri/net/state/feature/marking.rb
|
91
93
|
- lib/y_petri/net/state/features.rb
|
92
|
-
- lib/y_petri/net/state/features/dataset.rb
|
93
94
|
- lib/y_petri/net/state/features/record.rb
|
94
95
|
- lib/y_petri/net/timed.rb
|
95
96
|
- lib/y_petri/net/visualization.rb
|
96
97
|
- lib/y_petri/place.rb
|
97
98
|
- lib/y_petri/place/arcs.rb
|
98
99
|
- lib/y_petri/place/guard.rb
|
100
|
+
- lib/y_petri/place/guarded.rb
|
99
101
|
- lib/y_petri/simulation.rb
|
100
102
|
- lib/y_petri/simulation/dependency.rb
|
101
103
|
- lib/y_petri/simulation/element_representation.rb
|
@@ -147,13 +149,16 @@ files:
|
|
147
149
|
- lib/y_petri/simulation/transitions/ts.rb
|
148
150
|
- lib/y_petri/simulation/transitions/types.rb
|
149
151
|
- lib/y_petri/transition.rb
|
152
|
+
- lib/y_petri/transition/A.rb
|
153
|
+
- lib/y_petri/transition/T.rb
|
150
154
|
- lib/y_petri/transition/arcs.rb
|
151
|
-
- lib/y_petri/transition/assignment.rb
|
152
155
|
- lib/y_petri/transition/cocking.rb
|
153
|
-
- lib/y_petri/transition/
|
154
|
-
- lib/y_petri/transition/
|
155
|
-
- lib/y_petri/transition/
|
156
|
-
- lib/y_petri/transition/
|
156
|
+
- lib/y_petri/transition/construction_convenience.rb
|
157
|
+
- lib/y_petri/transition/t.rb
|
158
|
+
- lib/y_petri/transition/type.rb
|
159
|
+
- lib/y_petri/transition/type_information.rb
|
160
|
+
- lib/y_petri/transition/types.rb
|
161
|
+
- lib/y_petri/transition/usable_without_world.rb
|
157
162
|
- lib/y_petri/version.rb
|
158
163
|
- lib/y_petri/world.rb
|
159
164
|
- lib/y_petri/world/dependency.rb
|
@@ -1,135 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
class YPetri::Net::State
|
4
|
-
class Features
|
5
|
-
# Dataset is a collection of labeled state records.
|
6
|
-
#
|
7
|
-
class Dataset < Hash
|
8
|
-
class << self
|
9
|
-
alias __new__ new
|
10
|
-
|
11
|
-
def new
|
12
|
-
__new__ do |hsh, missing|
|
13
|
-
case missing
|
14
|
-
when Float then nil
|
15
|
-
else hsh[ missing.to_f ] end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
alias events keys
|
21
|
-
alias records values
|
22
|
-
|
23
|
-
delegate :features, to: "self.class"
|
24
|
-
delegate :net, to: :features
|
25
|
-
delegate :State, to: :net
|
26
|
-
|
27
|
-
# Revives records from values.
|
28
|
-
#
|
29
|
-
def records
|
30
|
-
values.map { |value| features.Record.new( value ) }
|
31
|
-
end
|
32
|
-
|
33
|
-
# Recreates the simulation at a given event label.
|
34
|
-
#
|
35
|
-
def reconstruct event: event, **settings # settings include marking clampls
|
36
|
-
interpolate( event ).reconstruct **settings
|
37
|
-
end
|
38
|
-
|
39
|
-
# Interpolates the recording an the given point (event).
|
40
|
-
#
|
41
|
-
def interpolate( event )
|
42
|
-
# TODO: This whole interpolation thing is unfinished.
|
43
|
-
begin
|
44
|
-
record( event )
|
45
|
-
rescue KeyError => msg
|
46
|
-
timed? or raise TypeError, "Event #{event} does not have a record!"
|
47
|
-
f_time, floor = floor( event ) # timed datasets support floor, ceiling
|
48
|
-
c_time, ceiling = ceiling( time )
|
49
|
-
floor + ( ceiling - floor ) / ( c_time - f_time ) * ( time - f_time )
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
# Returns the data series for the specified features.
|
54
|
-
#
|
55
|
-
def series arg=nil
|
56
|
-
return records.transpose if arg.nil?
|
57
|
-
reduce_features( State().features( arg ) ).series
|
58
|
-
end
|
59
|
-
|
60
|
-
# Expects a hash of features (:marking (alias :state) of places, :firing
|
61
|
-
# of tS transitions, :delta of places and/or transitions) and returns the
|
62
|
-
# corresponding mapping of the recording.
|
63
|
-
#
|
64
|
-
def reduce_features features
|
65
|
-
rf = net.State.features( features )
|
66
|
-
rr_class = rf.Record
|
67
|
-
rf.new_dataset.tap do |ds|
|
68
|
-
( events >> records ).each_pair { |event, record|
|
69
|
-
ds.update event => rr_class.load( rf.map { |f| record.fetch f } )
|
70
|
-
}
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def marking *args
|
75
|
-
return reduce_features features.select { |f| f.is_a? YPetri::Net::State::Feature::Marking } if args.empty?
|
76
|
-
reduce_features marking: args.first
|
77
|
-
end
|
78
|
-
|
79
|
-
def firing *args
|
80
|
-
return reduce_features features.select { |f| f.is_a? YPetri::Net::State::Feature::Firing } if args.empty?
|
81
|
-
reduce_features firing: args.first
|
82
|
-
end
|
83
|
-
|
84
|
-
def flux *args
|
85
|
-
return reduce_features features.select { |f| f.is_a? YPetri::Net::State::Feature::Flux } if args.empty?
|
86
|
-
reduce_features flux: args.first
|
87
|
-
end
|
88
|
-
|
89
|
-
def gradient *args
|
90
|
-
return reduce_features features.select { |f| f.is_a? YPetri::Net::State::Feature::Gradient } if args.empty?
|
91
|
-
reduce_features gradient: args
|
92
|
-
end
|
93
|
-
|
94
|
-
def delta *args
|
95
|
-
return reduce_features features.select { |f| f.is_a? YPetri::Net::State::Feature::Delta } if args.empty?
|
96
|
-
reduce_features delta: args
|
97
|
-
end
|
98
|
-
|
99
|
-
# Outputs the current recording in CSV format.
|
100
|
-
#
|
101
|
-
def to_csv
|
102
|
-
map { |lbl, rec| [ lbl, *rec ].join ',' }.join "\n"
|
103
|
-
end
|
104
|
-
|
105
|
-
# Plots the dataset.
|
106
|
-
#
|
107
|
-
def plot time: nil, **nn
|
108
|
-
events = events()
|
109
|
-
data_ss = series
|
110
|
-
x_range = if time.is_a? Range then
|
111
|
-
"[#{time.begin}:#{time.end}]"
|
112
|
-
else
|
113
|
-
"[-0:#{SY::Time.magnitude( time ).amount rescue time}]"
|
114
|
-
end
|
115
|
-
|
116
|
-
Gnuplot.open do |gp|
|
117
|
-
Gnuplot::Plot.new gp do |plot|
|
118
|
-
plot.xrange x_range
|
119
|
-
plot.title nn[:title] || "#{net} plot"
|
120
|
-
plot.ylabel nn[:ylabel] || "Values"
|
121
|
-
plot.xlabel nn[:xlabel] || "Time [s]"
|
122
|
-
|
123
|
-
features.labels.zip( data_ss )
|
124
|
-
.each { |label, data_array|
|
125
|
-
plot.data << Gnuplot::DataSet.new( [ events, data_array ] ) { |ds|
|
126
|
-
ds.with = "linespoints"
|
127
|
-
ds.title = label
|
128
|
-
}
|
129
|
-
}
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end # class Dataset
|
134
|
-
end # class Features
|
135
|
-
end # YPetri::Simulation::State
|