class PetriNet::Base

Common structure

Attributes

logger[RW]

Accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class.

Public Class Methods

new(options = {}) click to toggle source

Initialize the base class.

# File lib/petri_net/base.rb, line 11
def initialize(options = {})
        @logger = Logger.new(STDOUT)
        @logger.level = Logger::INFO
end

Public Instance Methods

next_object_id() click to toggle source

Get the next object ID (object count).

# File lib/petri_net/base.rb, line 17
def next_object_id
        @@object_count += 1
end
reset() click to toggle source

Resets the object-count This should not be used without extreme care It’s made for testing-purposes only

# File lib/petri_net/base.rb, line 24
def reset
    @@object_count = 0
end