Module: YPetri::Transition::TypeInformation
- Defined in:
- lib/y_petri/transition/type.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?.
-
#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?
)
100 101 102 |
# File 'lib/y_petri/transition/type.rb', line 100 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.)
92 93 94 |
# File 'lib/y_petri/transition/type.rb', line 92 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.
62 63 64 |
# File 'lib/y_petri/transition/type.rb', line 62 def functional? @functional end |
#functionless? ⇒ Boolean
Opposite of #functional?
68 69 70 |
# File 'lib/y_petri/transition/type.rb', line 68 def functionless? not functional? end |
#nonstoichiometric? ⇒ Boolean Also known as: s?
Is this a non-stoichiometric transition?
35 36 37 |
# File 'lib/y_petri/transition/type.rb', line 35 def nonstoichiometric? ! stoichiometric? end |
#stoichiometric? ⇒ Boolean Also known as: S?
Is this a stoichiometric transition?
30 |
# File 'lib/y_petri/transition/type.rb', line 30 def stoichiometric?; @stoichiometric end |
#timed? ⇒ Boolean Also known as: T?
Does the transition’s action depend on delta time?
42 43 44 |
# File 'lib/y_petri/transition/type.rb', line 42 def timed? @timed end |
#timeless? ⇒ Boolean Also known as: t?
Is the transition timeless? (Opposite of #timed?)
49 50 51 |
# File 'lib/y_petri/transition/type.rb', line 49 def timeless? not timed? end |
#ts? ⇒ Boolean
Is this a timeless non-stoichiometric transition?
24 25 26 |
# File 'lib/y_petri/transition/type.rb', line 24 def ts? type == :ts end |
#Ts? ⇒ Boolean
Is this a timed non-stoichiometric transition?
12 13 14 |
# File 'lib/y_petri/transition/type.rb', line 12 def Ts? type == :Ts end |
#TS? ⇒ Boolean
Is this a timed stoichiometric transition?
6 7 8 |
# File 'lib/y_petri/transition/type.rb', line 6 def TS? type == :TS end |
#tS? ⇒ Boolean
Is this a timeless stoichiometric transition?
18 19 20 |
# File 'lib/y_petri/transition/type.rb', line 18 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
83 84 85 86 |
# File 'lib/y_petri/transition/type.rb', line 83 def type return :A if assignment_action? timed? ? ( stoichiometric? ? :TS : :Ts ) : ( stoichiometric? ? :tS : :ts ) end |