Sha256: d1f43b4ce13e2d3c7e103c548e112393d97595818293a058c56cf58bb87f23a5

Contents?: true

Size: 993 Bytes

Versions: 15

Compression:

Stored size: 993 Bytes

Contents

# encoding: utf-8

# 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.
#
class YPetri::Simulation::NodeRepresentation
  ★ NameMagic
  ★ YPetri::Simulation::Dependency

  attr_reader :source # source place

  delegate :simulation, to: "self.class"

  # Expect a single YPetri node (place or transition) as an argument.
  # 
  def initialize net_node_id
    @source = net.node( net_node_id )
  end

  # Tweak the #to_s method to give the node representations the inspect string
  # of type #<Name>.
  # 
  def to_s
    "#<#{super}>"
  end
end # class YPetri::Simulation::NodeRepresentation

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
y_petri-2.4.9 lib/y_petri/simulation/node_representation.rb
y_petri-2.4.8 lib/y_petri/simulation/node_representation.rb
y_petri-2.4.6 lib/y_petri/simulation/node_representation.rb
y_petri-2.4.4 lib/y_petri/simulation/node_representation.rb
y_petri-2.4.3 lib/y_petri/simulation/node_representation.rb
y_petri-2.4.2 lib/y_petri/simulation/node_representation.rb
y_petri-2.4.0 lib/y_petri/simulation/node_representation.rb
y_petri-2.3.12 lib/y_petri/simulation/node_representation.rb
y_petri-2.3.11 lib/y_petri/simulation/node_representation.rb
y_petri-2.3.10 lib/y_petri/simulation/node_representation.rb
y_petri-2.3.9 lib/y_petri/simulation/node_representation.rb
y_petri-2.3.8 lib/y_petri/simulation/node_representation.rb
y_petri-2.3.6 lib/y_petri/simulation/node_representation.rb
y_petri-2.3.5 lib/y_petri/simulation/node_representation.rb
y_petri-2.3.4 lib/y_petri/simulation/node_representation.rb