diff --git a/lib/simplekit.rb b/lib/simplekit.rb index c6452be7b94fb9b98997e4ba6cd777b8948ef8d4..e9b14834780c9b5224d3785a1091c92a74623794 100644 --- a/lib/simplekit.rb +++ b/lib/simplekit.rb @@ -1,5 +1,5 @@ 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