module YPetri::Simulation::Transitions::Access
Public Instance Methods
Does a transition belong to the simulation?
# File lib/y_petri/simulation/transitions/access.rb, line 9 def includes_transition?( transition ) true.tap { begin; transition( transition ); rescue NameError, TypeError return false end } end
Net's transition.
# File lib/y_petri/simulation/transitions/access.rb, line 18 def t( transition ) transition( transition ).source end
Protected Instance Methods
Simulation's A transitions. Expects a single array of A
transitions or their ids and returns an array of the corresponding A transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 177 def A_Transitions( array ) transitions.A.subset( array ) end
Simulation's A transitions. Without arguments, returns all the A transitions of the simulation. Otherwise, it accepts an arbitrary number of A transitions or transition ids as arguments, and returns an array of the corresponding A transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 186 def A_transitions( *transitions ) return transitions().A if transitions.empty? A_Transitions( transitions ) end
Simulation's S transitions. Expects a single array of S
transitions or their ids and returns an array of the corresponding S transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 213 def S_Transitions( array ) transitions.S.subset( array ) end
Simulation's S transitions. Without arguments, returns all the S transitions of the simulation. Otherwise, it accepts an arbitrary number of S transitions or transition ids as arguments, and returns an array of the corresponding S transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 222 def S_transitions( *transitions ) return transitions().S if transitions.empty? S_Transitions( transitions ) end
Simulation's TS transitions. Expects a single array of TS
transitions or their ids and returns an array of the corresponding TS transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 159 def TS_Transitions( array ) transitions.TS.subset( array ) end
Simulation's TS transitions. Without arguments, returns all the TS transitions of the simulation. Otherwise, it accepts an arbitrary number of TS transitions or transition ids as arguments, and returns an array of the corresponding TS transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 168 def TS_transitions( *transitions ) return transitions().TS if transitions.empty? TS_Transitions( transitions ) end
Simulation's T transitions. Expects a single array of T
transitions or their ids and returns an array of the corresponding T transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 249 def T_Transitions( array ) transitions.T.subset( array ) end
Simulation's T transitions. Without arguments, returns all the T transitions of the simulation. Otherwise, it accepts an arbitrary number of T transitions or transition ids as arguments, and returns an array of the corresponding T transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 258 def T_transitions( *transitions ) return transitions().T if transitions.empty? T_Transitions( transitions ) end
Constructs an instance of @Transitions parametrized subclass. Expects a single array of transitions or transition ids and returns an array of corresponding transition representations in the simulation. Note that the includer of the Transitions::Access
module normally overloads :Transitions message in such way, that even without an argument, it does not fil, but returns @Transitions parametrized subclass itself.
# File lib/y_petri/simulation/transitions/access.rb, line 87 def Transitions( array ) TransitionsPS().load array.map &method( :transition ) end
Simulation's Ts transitions. Expects a single array of Ts
transitions or their ids and returns an array of the corresponding Ts transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 141 def Ts_Transitions( array ) transitions.Ts.subset( array ) end
Simulation's Ts transitions. Without arguments, returns all the Ts transitions of the simulation. Otherwise, it accepts an arbitrary number of Ts transitions or transition ids as arguments, and returns an array of the corresponding Ts transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 150 def Ts_transitions( *transitions ) return transitions().Ts if transitions.empty? Ts_Transitions( transitions ) end
Simulation's a transitions. Expects a single array of a
transitions or their ids and returns an array of the corresponding a transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 195 def a_Transitions( array ) transitions.a.subset( array ) end
Simulation's a transitions. Without arguments, returns all the a transitions of the simulation. Otherwise, it accepts an arbitrary number of a transitions or transition ids as arguments, and returns an array of the corresponding a transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 204 def a_transitions( *transitions ) return transitions().a if transitions.empty? a_Transitions( transitions ) end
Simulation's s transitions. Expects a single array of s
transitions or their ids and returns an array of the corresponding s transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 231 def s_Transitions( array ) transitions.s.subset( array ) end
Simulation's s transitions. Without arguments, returns all the s transitions of the simulation. Otherwise, it accepts an arbitrary number of s transitions or transition ids as arguments, and returns an array of the corresponding s transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 240 def s_transitions( *transitions ) return transitions().s if transitions.empty? s_Transitions( transitions ) end
Simulation's tS transitions. Expects a single array of tS
transitions or their ids and returns an array of the corresponding tS transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 123 def tS_Transitions( array ) transitions.tS.subset( array ) end
Simulation's tS transitions. Without arguments, returns all the tS transitions of the simulation. Otherwise, it accepts an arbitrary number of tS transitions or transition ids as arguments, and returns an array of the corresponding tS transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 132 def tS_transitions( *transitions ) return transitions().tS if transitions.empty? tS_Transitions( transitions ) end
Simulation's t transitions. Expects a single array of t
transitions or their ids and returns an array of the corresponding t transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 267 def t_Transitions( array ) transitions.t.subset( array ) end
Simulation's t transitions. Without arguments, returns all the t transitions of the simulation. Otherwise, it accepts an arbitrary number of t transitions or transition ids as arguments, and returns an array of the corresponding t transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 276 def t_transitions( *transitions ) return transitions().t if transitions.empty? t_Transitions( transitions ) end
Transition instance identification.
# File lib/y_petri/simulation/transitions/access.rb, line 68 def transition( transition ) begin; TransitionPS().instance( transition ); rescue NameError, TypeError begin transition = net.transition( transition ) TransitionPS().instances.find { |t_rep| t_rep.source == transition } || TransitionPS().instance( transition.name ) rescue NameError, TypeError => msg fail TypeError, "Unknown transition instance: #{transition}! (#{msg})" end end end
Without arguments, returns all the transition representations in the simulation. Otherwise, it accepts an arbitrary number of nodes or node ids as arguments, and returns an array of the corresponding transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 96 def transitions( *transitions ) return @transitions if transitions.empty? Transitions( transitions ) end
Simulation's ts transitions. Expects a single array of ts
transitions or their ids and returns an array of the corresponding ts transition representations.
# File lib/y_petri/simulation/transitions/access.rb, line 105 def ts_Transitions( array ) transitions.ts.subset( array ) end
Simulation's ts transitions. Without arguments, returns all the ts transitions of the simulation. Otherwise, it accepts an arbitrary number of ts transitions or transition ids as arguments, and returns an array of the corresponding ts transitions of the simulation.
# File lib/y_petri/simulation/transitions/access.rb, line 114 def ts_transitions( *transitions ) return transitions().ts if transitions.empty? ts_Transitions( transitions ) end