lib/y_petri/simulation/timed.rb in y_petri-2.1.40 vs lib/y_petri/simulation/timed.rb in y_petri-2.1.42
- old
+ new
@@ -150,10 +150,11 @@
# @time_unit and @time (via +#reset_time!+ call). Also sets up the
# parametrized subclasses +@Core+ and +@Recorder+, and initializes the
# +@recorder+ attribute.
#
def init **settings
+ method = settings[:method] # the simulation method
if settings.has? :time, syn!: :time_range then # time range given
case settings[:time]
when Range then
time_range = settings[:time]
@initial_time, @target_time = time_range.begin, time_range.end
@@ -173,9 +174,10 @@
end
init_core_and_recorder_subclasses
reset_time!
@step = settings[:step] || time_unit
@default_sampling = settings[:sampling] || step
+ @core = Core().new( method: method, guarded: guarded )
@recorder = Recorder().new sampling: settings[:sampling]
end
# Sets up subclasses of +Core+ (the simulator) and +Recorder+ (the sampler)
# for timed simulations.