class YPetri::Simulation::InitialMarking

Simulation mixin providing access to the initial marking.

Public Instance Methods

set( place_id, to: (fail ArgumentError) ) click to toggle source

Sets the initial marking for a given place to a given value.

Calls superclass method
# File lib/y_petri/simulation/initial_marking.rb, line 7
def set( place_id, to: (fail ArgumentError) )
  fail TypeError, "The place #{place_id} is already clamped!" if
    begin # fails if marking clamps are not set yet
      place( place_id ).clamped?
    rescue TypeError, NoMethodError; end
  super
end