Skip to content
Snippets Groups Projects
Commit a8e2699d authored by pjs's avatar pjs
Browse files

refactored to use skewheap instead of pqueue


Signed-off-by: default avatarpjs <pjs@alum.mit.edu>
parent 33c48419
No related branches found
No related tags found
No related merge requests found
require 'rubygems'
require 'pqueue'
require 'skewheap'
# Including SimpleKit gives you methods :run, :model_time, :schedule,
# and :halt as mixins. You <b>MUST NOT</b> provide your own implementations
......@@ -25,7 +25,7 @@ module SimpleKit
end
# This class provides the computation engine for a discrete event
# simulation model. It uses RubyGem's PQueue class as the priority
# simulation model. It uses RubyGem's SkewHeap class as the priority
# queue implementation for the pending events list.
#
# Users must create a model class which
......@@ -36,7 +36,7 @@ module SimpleKit
def initialize(the_model)
@user_model = the_model
@event_list = PQueue.new
@event_list = SkewHeap.new
end
public
......@@ -89,7 +89,7 @@ module SimpleKit
end
def <=> (other)
other.time <=> time
time <=> other.time
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment