Class: Pione::PNML::Arc
- Inherits:
-
StructX
- Object
- StructX
- Pione::PNML::Arc
- Defined in:
- lib/pione/pnml/pnml-model.rb
Overview
Arc
is a class represents arcs in PT-net.
Instance Method Summary collapse
-
#from_place_to_transition? ⇒ Boolean
Return true if the arc has the direction from place to transition.
-
#from_transition_to_place? ⇒ Boolean
Return true if the arc has the direction from transition to place.
- #inspect ⇒ Object
Instance Method Details
#from_place_to_transition? ⇒ Boolean
Return true if the arc has the direction from place to transition.
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.
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 |
#inspect ⇒ Object
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 |