Class: PetriNet::Base
- Inherits:
-
Object
- Object
- PetriNet::Base
- Defined in:
- lib/petri_net/base.rb
Overview
Common structure
Direct Known Subclasses
Arc, CoverabilityGraph, CoverabilityGraph::Edge, CoverabilityGraph::Node, Graph, Graph::Edge, Graph::Node, Marking, Net, Place, Transition
Constant Summary collapse
- @@object_count =
Global object count.
0
Instance Attribute Summary collapse
-
#logger ⇒ Object
Accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
Initialize the base class.
-
#next_object_id ⇒ Object
Get the next object ID (object count).
-
#reset ⇒ Object
Resets the object-count This should not be used without extreme care It’s made for testing-purposes only.
Constructor Details
#initialize(options = {}) ⇒ Base
Initialize the base class.
11 12 13 14 |
# File 'lib/petri_net/base.rb', line 11 def initialize( = {}) @logger = Logger.new(STDOUT) @logger.level = Logger::INFO end |
Instance Attribute Details
#logger ⇒ Object
Accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class.
5 6 7 |
# File 'lib/petri_net/base.rb', line 5 def logger @logger end |
Instance Method Details
#next_object_id ⇒ Object
Get the next object ID (object count).
17 18 19 |
# File 'lib/petri_net/base.rb', line 17 def next_object_id @@object_count += 1 end |
#reset ⇒ Object
Resets the object-count This should not be used without extreme care It’s made for testing-purposes only
24 25 26 |
# File 'lib/petri_net/base.rb', line 24 def reset @@object_count = 0 end |