Class: Pione::PNML::Arc

Inherits:
StructX
  • Object
show all
Defined in:
lib/pione/pnml/pnml-model.rb

Overview

Arc is a class represents arcs in PT-net.

Instance Method Summary collapse

Instance Method Details

#from_place_to_transition?Boolean

Return true if the arc has the direction from place to transition.

Returns:

  • (Boolean)


391
392
393
# File 'lib/pione/pnml/pnml-model.rb', line 391

def from_place_to_transition?
  net.places.any? {|p| p.id == source_id} and net.transitions.any? {|t| t.id == target_id}
end

#from_transition_to_place?Boolean

Return true if the arc has the direction from transition to place.

Returns:

  • (Boolean)


386
387
388
# File 'lib/pione/pnml/pnml-model.rb', line 386

def from_transition_to_place?
  net.transitions.any? {|t| t.id == source_id} and net.places.any? {|p| p.id == target_id}
end

#inspectObject



395
396
397
# File 'lib/pione/pnml/pnml-model.rb', line 395

def inspect
  "#<Pione::PNML::Arc id=%s source_id=%s target_id=%s>" % [id.inspect, source_id.inspect, target_id.inspect]
end