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

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)

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

def ts?; type == :ts end

#TS?Boolean

Is this a TS transition?

Returns:

  • (Boolean)

40
# 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)

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

def tS?; type == :tS end

#Ts?Boolean

Is this a Ts transition?

Returns:

  • (Boolean)

44
# File 'lib/y_petri/simulation/transition_representation/types.rb', line 44

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