Class: PetriNet::ReachabilityGraph
- Defined in:
- lib/petri_net/reachability_graph/graph.rb
Defined Under Namespace
Classes: Edge, InfinityNode, Node
Instance Attribute Summary
Attributes inherited from Graph
Attributes inherited from Base
Instance Method Summary collapse
- #add_node(node) ⇒ Object
- #add_node!(node) ⇒ Object
-
#initialize(net, options = Hash.new) ⇒ ReachabilityGraph
constructor
A new instance of ReachabilityGraph.
Methods inherited from Graph
#<<, #add_edge, #generate_gv, #get_node, #get_nodes, #to_gv, #to_s
Methods inherited from Base
Constructor Details
#initialize(net, options = Hash.new) ⇒ ReachabilityGraph
Returns a new instance of ReachabilityGraph.
4 5 6 7 8 |
# File 'lib/petri_net/reachability_graph/graph.rb', line 4 def initialize(net, = Hash.new) [:type] = "Reachability" super(net, ) self end |
Instance Method Details
#add_node(node) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/petri_net/reachability_graph/graph.rb', line 10 def add_node(node) @nodes.each_value do |n| begin if @objects[n] < node raise PetriNet::InfiniteReachabilityGraphError end rescue ArgumentError #Just an InfiniteNode end end super node end |
#add_node!(node) ⇒ Object
24 25 26 |
# File 'lib/petri_net/reachability_graph/graph.rb', line 24 def add_node!(node) super node end |