Module: YPetri::Simulation::TransitionRepresentation::Types

Included in:
YPetri::Simulation::TransitionRepresentation
Defined in:
lib/y_petri/simulation/transition_representation/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typeObject (readonly)

The transition’s type.



33
34
35
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 33

def type
  @type
end

Instance Method Details

#Ts?Boolean

Is this a Ts transition?

Returns:

  • (Boolean)


46
47
48
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 46

def Ts?
  type == :Ts
end

#TS?Boolean

Is this a TS transition?

Returns:

  • (Boolean)


40
41
42
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 40

def TS?
  type == :TS
end

#ts?Boolean

Is this a ts transition?

Returns:

  • (Boolean)


58
59
60
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 58

def ts?
  type == :ts
end

#tS?Boolean

Is this a tS transition?

Returns:

  • (Boolean)


52
53
54
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 52

def tS?
  type == :tS
end

#type_init(*args) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 20

def type_init *args
  extend case source.type
         when :A then Type_A
         when :TS then Type_TS
         when :Ts then Type_Ts
         when :tS then Type_tS
         when :ts then Type_ts
         else fail TypeError, "Unknown tr. type #{source.type}!" end
  init
end