lib/y_petri/simulation/transitions/access.rb in y_petri-2.1.3 vs lib/y_petri/simulation/transitions/access.rb in y_petri-2.1.6

- old
+ new

@@ -12,94 +12,138 @@ return false end } end alias include_transition? includes_transition? - # Transition of the simulation (belonging to the net). + # Net's transition. # def t( id ) transitions( id ).source end - # Transitions of the simulation (belonging to the net). + # Net's transitions. # def tt( ids=nil ) transitions( ids ).sources end - # Free places of the simulation (belonging to the net). + # Net's *ts* transitions. # def ts_tt( ids=nil ) ts_transitions( ids ).sources end - # Free places of the simulation (belonging to the net). + # Net's *tS* transitions. # def tS_tt( ids=nil ) tS_transitions( ids ).sources end - # Free places of the simulation (belonging to the net). + + # Net's *Ts* transitions. # def Ts_tt( ids=nil ) Ts_transitions( ids ).sources end - # Free places of the simulation (belonging to the net). + # Net's *TS* transitions. # def TS_tt( ids=nil ) TS_transitions( ids ).sources end - # Transitions' names. Arguments, if any, are treated as in +#tranistions+ method. + # Net's *A* transitions. # + def A_tt( ids=nil ) + A_transitions( ids ).sources + end + + # Net's *S* transitions. + # + def S_tt( ids=nil ) + S_transitions( ids ).sources + end + + # Net's *s* (non-stoichiometric) transitions. + # + def s_tt( ids=nil ) + s_transitions( ids ).sources + end + + # Net's *T* transitions. + # + def T_tt( ids=nil ) + T_transitions( ids ).sources + end + + # Net's *t* (timeless) transitions. + # + def t_tt ids=nil + return transitions.t if ids.nil? + transitions.t.subset( ids ) + end + + # Names of specified transitions. + # def tn ids=nil - transitions( ids ).names + tt( ids ).names end - # Names of *ts* transitions. Arguments are handled as with +#ts_transitions+. + # Names of specified *ts* transitions. # def nts ids=nil - ts_transitions( ids ).names( true ) + ts_tt( ids ).names( true ) end - # Names of *tS* transitions. Arguments are handled as with +#tS_transitions+. + # Names of specified *tS* transitions. # def ntS ids=nil - tS_transitions( ids ).names( true ) + tS_tt( ids ).names( true ) end - # Names of *Ts* transitions. Arguments are handled as with +#tS_transitions+. + # Names of specified *Ts* transitions. # def nTs ids=nil - Ts_transitions( ids ).names( true ) + Ts_tt( ids ).names( true ) end - # Names of *TS* transitions. Arguments are handled as with +#TS_transitions+. + # Names of specified *TS* transitions. # def nTS ids=nil - TS_transitions( ids ).names( true ) + TS_tt( ids ).names( true ) end - # Names of *A* transitions. Arguments are handled as with +#A_transitions+. + # Names of specified *A* transitions. # def nA ids=nil - A_transitions( ids ).names( true ) + A_tt( ids ).names( true ) end - # Names of *S* transitions. Arguments are handled as with +#S_transitions+. + # Names of specified *S* transitions. # def nS ids=nil - S_transitions( ids ).names( true ) + S_tt( ids ).names( true ) end - # Names of *s* transitions. Arguments are handled as with +#s_transitions+. + # Names of specified *s* transitions. # def ns ids=nil - s_transitions( ids ).names( true ) + s_tt( ids ).names( true ) end + # Names of specified *T* transitions. + # + def nT ids=nil + T_tt( ids ).names( true ) + end + + # Names of specified *t* transitions. + # + def nt ids=nil + t_tt( ids ).names( true ) + end + protected # Transition instance identification. # def transition( id ) @@ -130,57 +174,81 @@ # transitions are not considered eligible *ts* tranisitions for the purposes # of this method. # def ts_transitions ids=nil return transitions.ts if ids.nil? - transitions.ts.subset( ids ) + transitions.ts.subset( transitions ids ) end # Simulation's *tS* transitions. If arguments are given, they must identify # *tS* transitions, and are treated as in +#transitions+ method. # def tS_transitions ids=nil return transitions.tS if ids.nil? - transitions.tS.subset( ids ) + transitions.tS.subset( transitions ids ) end # Simulation's *Ts* transitions. If arguments are given, they must identify # *Ts* transitions, and are treated as in +#transitions+ method. # def Ts_transitions ids=nil return transitions.Ts if ids.nil? - transitions.Ts.subset( ids ) + transitions.Ts.subset( transitions ids ) end # Simulation's *TS* transitions. If arguments are given, they must identify # *TS* transitions, and are treated as in +#transitions+ method. # def TS_transitions ids=nil return transitions.TS if ids.nil? - transitions.TS.subset( ids ) + transitions.TS.subset( transitions ids ) end # Simulation's *A* transitions. If arguments are given, they must identify # *A* transitions, and are treated as in +#transitions+ method. # def A_transitions ids=nil return transitions.A if ids.nil? - transitions.A.subset( ids ) + transitions.A.subset( transitions ids ) end + # Simulation's *a* transitions. If argument are given, they must identify + # *a* transitions, and are treated as in +#transitions+ method. + # + def a_transitions ids=nil + return transitions.a if ids.nil? + transitions.a.subset( transitions ids ) + end + # Simulation's *S* transitions. If arguments are given, they must identify # *S* transitions, and are treated as in +#transitions+ method. # def S_transitions ids=nil return transitions.S if ids.nil? - transitions.S.subset( ids ) + transitions.S.subset( transitions ids ) end # Simulation's *s* transitions. If arguments are given, they must identify # *s* transitions, and are treated as in +#transitions+ method. # def s_transitions ids=nil return transitions.s if ids.nil? - transitions.s.subset( ids ) + transitions.s.subset( transitions ids ) + end + + # Simulation's *T* transitions. If arguments are given, they must identify + # *T* transitions, and are treated as in +#transitions+ method. + # + def T_transitions ids=nil + return transitions.T if ids.nil? + transitions.T.subset( transitions ids ) + end + + # Simulation's *t* transitions. If arguments are given, they must identify + # *t* transitions, and are treated as in +#transitions+ method. + # + def t_transitions ids=nil + return transitions.t if ids.nil? + transitions.t.subset( transitions ids ) end end # Access end # class YPetri::Simulation::Transitions