class YPetri::Simulation::PlaceRepresentation
Attributes
quantum[R]
Public Class Methods
new(net_place)
click to toggle source
Expect a single YPetri
place as an argument.
Calls superclass method
YPetri::Simulation::NodeRepresentation::new
# File lib/y_petri/simulation/place_representation.rb, line 17 def initialize net_place super @quantum = source.quantum end
Public Instance Methods
clamp=( value )
click to toggle source
Setter of clamp.
# File lib/y_petri/simulation/place_representation.rb, line 24 def clamp=( value ) simulation.set_marking_clamp( self, to: value ) end
clamped?()
click to toggle source
Is the place clamped in the current simulation?
# File lib/y_petri/simulation/place_representation.rb, line 55 def clamped? simulation.marking_clamps.places.include? self end
free?()
click to toggle source
Is the place free in the current simulation?
# File lib/y_petri/simulation/place_representation.rb, line 49 def free? simulation.initial_markings.places.include? self end
initial_marking()
click to toggle source
Initial marking value (or nil, if the place is free).
# File lib/y_petri/simulation/place_representation.rb, line 43 def initial_marking simulation.initial_marking( self ) if free? end
initial_marking=( value )
click to toggle source
Setter of initial marking.
# File lib/y_petri/simulation/place_representation.rb, line 30 def initial_marking=( value ) simulation.set_initial_marking( self, to: value ) end
m()
click to toggle source
Get the current marking of this place in the simulation.
# File lib/y_petri/simulation/place_representation.rb, line 73 def m m_vector[ self ] end
Also aliased as: marking
m=( value )
click to toggle source
Set the marking of this place in the simulation.
# File lib/y_petri/simulation/place_representation.rb, line 61 def m=( value ) m_vector.set self, value end
m_vector_index()
click to toggle source
Index.
# File lib/y_petri/simulation/place_representation.rb, line 11 def m_vector_index places.index( self ) end
marking=( value )
click to toggle source
Alias of m=
# File lib/y_petri/simulation/place_representation.rb, line 67 def marking=( value ) m=( value ) end
marking_clamp()
click to toggle source
Marking clamp value (or nil, if the place is clamped).
# File lib/y_petri/simulation/place_representation.rb, line 36 def marking_clamp simulation.marking_clamp( self ) if clamped? end
Also aliased as: clamp