module YPetri::Transition::Types

Public Instance Methods

A?()
Alias for: assignment_action?
B?()
Alias for: ts?
C?()
Alias for: tS?
D?()
Alias for: Ts?
E?()
Alias for: TS?
S?()
Alias for: stoichiometric?
T?()
Alias for: timed?
TS?() click to toggle source

Is this a timed stoichiometric transition?

# File lib/y_petri/transition/types.rb, line 47
def TS?
  type == :TS
end
Also aliased as: E?
Ts?() click to toggle source

Is this a timed non-stoichiometric transition?

# File lib/y_petri/transition/types.rb, line 40
def Ts?
  type == :Ts
end
Also aliased as: D?
a?() click to toggle source

Is this a non-assignment transition? (Opposite of #A?)

# File lib/y_petri/transition/types.rb, line 20
def a?
  ! assignment_action?
end
assignment?()
Alias for: assignment_action?
assignment_action?() click to toggle source

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.)

# File lib/y_petri/transition/types.rb, line 12
def assignment_action?
  @assignment_action
end
Also aliased as: assignment?, A?
functional?() click to toggle source

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.

# File lib/y_petri/transition/types.rb, line 91
def functional?
  @functional
end
functionless?() click to toggle source

Opposite of functional?

# File lib/y_petri/transition/types.rb, line 97
def functionless?
  not functional?
end
nonstoichiometric?() click to toggle source

Is this a non-stoichiometric transition?

# File lib/y_petri/transition/types.rb, line 59
def nonstoichiometric?
  ! stoichiometric?
end
Also aliased as: s?
s?()
Alias for: nonstoichiometric?
stoichiometric?() click to toggle source

Is this a stoichiometric transition?

# File lib/y_petri/transition/types.rb, line 54
def stoichiometric?; @stoichiometric end
Also aliased as: S?
t() click to toggle source

Reports the transition's membership in one of the 5 basic types using one-letter abbreviation:

  1. A .… assignment

  2. B .… timeless nonstoichiometric (ts)

  3. C .… timeless stoichiometric (tS)

  4. D .… timed nonstoichiometric (Ts)

  5. E .… timed stoichiometric (TS)

# File lib/y_petri/transition/types.rb, line 110
def t
  return :A if assignment_action?
  timed? ? ( stoichiometric? ? :E : :D ) : ( stoichiometric? ? :C : :B )
end
t?()
Alias for: timeless?
tS?() click to toggle source

Is this a timeless stoichiometric transition?

# File lib/y_petri/transition/types.rb, line 33
def tS?
  type == :tS
end
Also aliased as: C?
timed?() click to toggle source

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.)

# File lib/y_petri/transition/types.rb, line 69
def timed?
  return nil if A?
  @timed
end
Also aliased as: T?
timeless?() click to toggle source

Is the transition timeless? (Opposite of timed?)

# File lib/y_petri/transition/types.rb, line 77
def timeless?
  return nil if A?
  not timed?
end
Also aliased as: t?
ts?() click to toggle source

Is this a timeless non-stoichiometric transition?

# File lib/y_petri/transition/types.rb, line 26
def ts?
  type == :ts
end
Also aliased as: B?
type() click to toggle source

Reports the transition's membership in one of the 5 basic types using two-letter abbreviation + A for assignment transition. This methods reflects the fact that the new users may take time to memorize the meaning of A, B, C, D, E transition types. Two-letter abbreviations may be easier to figure out.

  1. A .… assignment transitions (A-type)

  2. ts .… timeless nonstoichiometric (B-type)

  3. tS .… timeless stoichiometric (C-type)

  4. Ts .… timed nonstoichiometric (D-type)

  5. TS .… timed stoichiometric (E-type)

# File lib/y_petri/transition/types.rb, line 127
def type
  { A: :A, B: :ts, C: :tS, D: :Ts, E: :TS }[ t ]
end
type_full() click to toggle source

Reports the transition's membership in one of the 5 basic types as a full string.

  1. assignment (A-type)

  2. timeless nonstoichiometric (B-type)

  3. timeless stoichiometric (C-type)

  4. timed nonstoichiometric (D-type)

  5. timed stoichiometric (E-type)

# File lib/y_petri/transition/types.rb, line 140
def type_full
  { A: "assignment",
    ts: "timeless nonstoichiometric",
    tS: "timeless stoichiometric",
    Ts: "timed nonstoichiometric",
    TS: "timed stoichiometric" }[ type ]
end