diff --git a/lib/simplekit.rb b/lib/simplekit.rb index 640f25c6dc1528bf212e0d6b6a0a02125465a330..9626adcce642d44464334b240eb59510700c7979 100644 --- a/lib/simplekit.rb +++ b/lib/simplekit.rb @@ -1,21 +1,22 @@ require 'rubygems' require 'pqueue' -# install the 'pqueue' gem before using SimpleKit: -# gem install pqueue -# or -# sudo gem install pqueue # on Unix systems/OS X. - +# You must install the 'pqueue' gem before using SimpleKit: +# <ul> +# <li>gem install pqueue<br> +# or<br> +# <li>sudo gem install pqueue # on Unix systems/OS X. +#</ul> +# Including SimpleKit gives you methods :run, :model_time, :schedule, +# and :halt as mixins. You <b>MUST NOT</b> provide your own implementations +# of methods with these names in your model. All but :run are +# delegated to the EventScheduler class. module SimpleKit - # including SimpleKit gives you methods :run, :model_time, - # :schedule, and :halt as mixins. You MUST NOT provide - # your own implementations of methods with these names in - # your model. All but :run are delegated to the Simulation - # class. DELEGATED_METHODS = [:model_time, :schedule, :halt] + # Run the model by creating a new EventScheduler and invoking its run method. def run - @mySim = Simulation.new(self) + @mySim = EventScheduler.new(self) @mySim.run end @@ -35,7 +36,7 @@ module SimpleKit # <li>Instantiates a model and invokes # the run() method to start execution. # </ul> - class Simulation + class EventScheduler attr_reader :model_time, :user_model def initialize(the_model)