y_petri 2.1.33 → 2.1.34
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.
- checksums.yaml +4 -4
- data/lib/y_petri/net/data_set.rb +8 -4
- data/lib/y_petri/net/state/feature/delta.rb +6 -0
- data/lib/y_petri/net/state/feature/firing.rb +6 -0
- data/lib/y_petri/net/state/feature/flux.rb +7 -1
- data/lib/y_petri/net/state/feature/gradient.rb +6 -0
- data/lib/y_petri/net/state/feature/marking.rb +6 -0
- data/lib/y_petri/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaa1e130702b9531a81dd9cc1edc9d9e62b8caf8
|
4
|
+
data.tar.gz: b55819cc1a3b556516105ff971b434a97e4cde9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64d8b917eae58576d9f3b0c359c6f09ba7be768cbb581996f41dd303cae2b074d5cac17c00d2d39c4cf82aa16d112360e862057ffc79fea8744fd88e4b936864
|
7
|
+
data.tar.gz: 8d3a8be4cc3728908fa2d44f1e1ba7ace44bc6c80808cad9ed4169c0552dd17caa0b5fcdb8e0c411ae1b0dc37afdd62ea5663b43402a8d0d347693dae7072054
|
data/lib/y_petri/net/data_set.rb
CHANGED
@@ -258,11 +258,15 @@ class YPetri::Net::DataSet < Hash
|
|
258
258
|
map { |lbl, rec| [ lbl, *rec ].join ',' }.join "\n"
|
259
259
|
end
|
260
260
|
|
261
|
-
# Plots the dataset.
|
261
|
+
# Plots the dataset. Takes several optional arguments: The list of features
|
262
|
+
# to plot as the first ordered argument,
|
262
263
|
#
|
263
|
-
def plot( time: nil, **nn )
|
264
|
+
def plot( feature_ids=nil, time: nil, except: [], **nn )
|
265
|
+
time = nn.may_have :time, syn!: :time_range
|
264
266
|
events = events()
|
265
|
-
|
267
|
+
ff = feature_ids.nil? ? features : net.state.features( feature_ids )
|
268
|
+
ff -= net.state.features( except )
|
269
|
+
data_ss = series( ff )
|
266
270
|
x_range = if time.nil? then
|
267
271
|
from = events.first || 0
|
268
272
|
to = events.last && events.last > from ? events.last :
|
@@ -279,7 +283,7 @@ class YPetri::Net::DataSet < Hash
|
|
279
283
|
plot.title nn[:title] || "#{net} plot"
|
280
284
|
plot.ylabel nn[:ylabel] || "Values"
|
281
285
|
plot.xlabel nn[:xlabel] || "Time [s]"
|
282
|
-
|
286
|
+
ff.labels.zip( data_ss ).each do |label, data_array|
|
283
287
|
plot.data << Gnuplot::DataSet.new( [ events, data_array ] ) { |ds|
|
284
288
|
ds.with = "linespoints"
|
285
289
|
ds.title = label
|
@@ -51,7 +51,7 @@ class YPetri::Net::State::Feature::Flux < YPetri::Net::State::Feature
|
|
51
51
|
# identifier).
|
52
52
|
#
|
53
53
|
def initialize id
|
54
|
-
@transition = net.transition
|
54
|
+
@transition = net.transition id.is_a?( Flux ) ? id.transition : id
|
55
55
|
end
|
56
56
|
|
57
57
|
# Extracts the receiver marking feature from the argument. This can be
|
@@ -66,6 +66,12 @@ class YPetri::Net::State::Feature::Flux < YPetri::Net::State::Feature
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
+
# Type of this feature.
|
70
|
+
#
|
71
|
+
def type
|
72
|
+
:flux
|
73
|
+
end
|
74
|
+
|
69
75
|
# A string briefly describing the flux feature.
|
70
76
|
#
|
71
77
|
def to_s
|
data/lib/y_petri/version.rb
CHANGED