Module: YPetri::World::Dependency

Defined in:
lib/y_petri/world/dependency.rb

Instance Method Summary collapse

Instance Method Details

#net(id) ⇒ Object

Net instance identification.



38
39
40
# File 'lib/y_petri/world/dependency.rb', line 38

def net id
  Net().instance( id )
end

#node(id) ⇒ Object

Node instance identification.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/y_petri/world/dependency.rb', line 24

def node id
  begin
    place( id )
  rescue NameError, TypeError
    begin
      transition( id )
    rescue NameError, TypeError => err
      raise TypeError, "Unrecognized node: #{id} (#{err})"
    end
  end
end

#place(id) ⇒ Object

Place instance identification.



12
13
14
# File 'lib/y_petri/world/dependency.rb', line 12

def place id
  world.place( id )
end

#transition(id) ⇒ Object

Transition instance identification.



18
19
20
# File 'lib/y_petri/world/dependency.rb', line 18

def transition id
  world.transition( id )
end