Class: YPetri::Simulation::NodeRepresentation
- Inherits:
-
Object
- Object
- YPetri::Simulation::NodeRepresentation
- Defined in:
- lib/y_petri/simulation/node_representation.rb
Overview
Representation of a YPetri
node inside a YPetri::Simulation
instance. An instance of YPetri::Simulation
does is constructed based on an instance of YPetri::Net
, but not directly work with Petri net nodes (that is, it does not work with instances of YPetri::Place
or YPetri::Transition
). Instead, it creates its own internal representations of the nodes of the Petri net it is constructed from – instances of NodeRepresentation.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
source place.
Instance Method Summary collapse
-
#initialize(net_node_id) ⇒ NodeRepresentation
constructor
Expect a single YPetri node (place or transition) as an argument.
-
#to_s ⇒ Object
Tweak the #to_s method to give the node representations the inspect string of type #<Name>.
Constructor Details
#initialize(net_node_id) ⇒ NodeRepresentation
Expect a single YPetri node (place or transition) as an argument.
20 21 22 |
# File 'lib/y_petri/simulation/node_representation.rb', line 20 def initialize net_node_id @source = net.node( net_node_id ) end |
Instance Attribute Details
#source ⇒ Object (readonly)
source place
14 15 16 |
# File 'lib/y_petri/simulation/node_representation.rb', line 14 def source @source end |
Instance Method Details
#to_s ⇒ Object
Tweak the #to_s method to give the node representations the inspect string of type #<Name>.
27 28 29 |
# File 'lib/y_petri/simulation/node_representation.rb', line 27 def to_s "#<#{super}>" end |