Module: YPetri::Transition::Types
- Defined in:
- lib/y_petri/transition/types.rb
Instance Method Summary collapse
-
#a? ⇒ Boolean
Is this a non-assignment transition? (Opposite of
#A?). -
#assignment_action? ⇒ Boolean
(also: #assignment?, #A?)
Is this a transition with assignment action? (Transitions with assignment action, or “assignment transitions”, completely replace the marking of their codomain with their action closure result, like in spreadsheets.).
-
#functional? ⇒ Boolean
Is the transition functional?.
-
#functionless? ⇒ Boolean
Opposite of #functional?.
-
#nonstoichiometric? ⇒ Boolean
(also: #s?)
Is this a non-stoichiometric transition?.
-
#stoichiometric? ⇒ Boolean
(also: #S?)
Is this a stoichiometric transition?.
-
#timed? ⇒ Boolean
(also: #T?)
Does the transition’s action depend on delta time? (Note that although A transitions are technically timeless, for pragmatic reasons, they are excluded from T/t classification, because they are generally handled differently in Petri net execution.).
-
#timeless? ⇒ Boolean
(also: #t?)
Is the transition timeless? (Opposite of #timed?).
-
#ts? ⇒ Boolean
Is this a timeless non-stoichiometric transition?.
-
#Ts? ⇒ Boolean
Is this a timed non-stoichiometric transition?.
-
#TS? ⇒ Boolean
Is this a timed stoichiometric transition?.
-
#tS? ⇒ Boolean
Is this a timeless stoichiometric transition?.
-
#type ⇒ Object
Reports the transition’s membership in one of the 4 basic types:.
Instance Method Details
#a? ⇒ Boolean
Is this a non-assignment transition? (Opposite of #A?)
109 110 111 |
# File 'lib/y_petri/transition/types.rb', line 109 def a? ! assignment_action? end |
#assignment_action? ⇒ Boolean Also known as: assignment?, A?
Is this a transition with assignment action? (Transitions with assignment action, or “assignment transitions”, completely replace the marking of their codomain with their action closure result, like in spreadsheets.)
101 102 103 |
# File 'lib/y_petri/transition/types.rb', line 101 def assignment_action? @assignment_action end |
#functional? ⇒ Boolean
Is the transition functional?
Explanation: If rate or action closure is supplied, a transition is always considered ‘functional’. Otherwise, it is considered not ‘functional’. Note that even transitions that are not functional still have standard action acc. to Petri’s definition. Also note that a timed transition is necessarily functional.
71 72 73 |
# File 'lib/y_petri/transition/types.rb', line 71 def functional? @functional end |
#functionless? ⇒ Boolean
Opposite of #functional?
77 78 79 |
# File 'lib/y_petri/transition/types.rb', line 77 def functionless? not functional? end |
#nonstoichiometric? ⇒ Boolean Also known as: s?
Is this a non-stoichiometric transition?
39 40 41 |
# File 'lib/y_petri/transition/types.rb', line 39 def nonstoichiometric? ! stoichiometric? end |
#stoichiometric? ⇒ Boolean Also known as: S?
Is this a stoichiometric transition?
34 |
# File 'lib/y_petri/transition/types.rb', line 34 def stoichiometric?; @stoichiometric end |
#timed? ⇒ Boolean Also known as: T?
Does the transition’s action depend on delta time? (Note that although A transitions are technically timeless, for pragmatic reasons, they are excluded from T/t classification, because they are generally handled differently in Petri net execution.)
49 50 51 52 |
# File 'lib/y_petri/transition/types.rb', line 49 def timed? return nil if A? @timed end |
#timeless? ⇒ Boolean Also known as: t?
Is the transition timeless? (Opposite of #timed?)
57 58 59 60 |
# File 'lib/y_petri/transition/types.rb', line 57 def timeless? return nil if A? not timed? end |
#ts? ⇒ Boolean
Is this a timeless non-stoichiometric transition?
28 29 30 |
# File 'lib/y_petri/transition/types.rb', line 28 def ts? type == :ts end |
#Ts? ⇒ Boolean
Is this a timed non-stoichiometric transition?
16 17 18 |
# File 'lib/y_petri/transition/types.rb', line 16 def Ts? type == :Ts end |
#TS? ⇒ Boolean
Is this a timed stoichiometric transition?
10 11 12 |
# File 'lib/y_petri/transition/types.rb', line 10 def TS? type == :TS end |
#tS? ⇒ Boolean
Is this a timeless stoichiometric transition?
22 23 24 |
# File 'lib/y_petri/transition/types.rb', line 22 def tS? type == :tS end |
#type ⇒ Object
Reports the transition’s membership in one of the 4 basic types:
-
TS .… timed stoichiometric
-
tS .… timeless stoichiometric
-
Ts .… timed nonstoichiometric
-
ts .… timeless nonstoichiometric
plus the fifth type
-
A .… assignment transitions
92 93 94 95 |
# File 'lib/y_petri/transition/types.rb', line 92 def type return :A if assignment_action? timed? ? ( stoichiometric? ? :TS : :Ts ) : ( stoichiometric? ? :tS : :ts ) end |