Class DESimulation

java.lang.Object
  extended by Simulation
      extended by DESimulation
Direct Known Subclasses:
FactorySimulation

public class DESimulation
extends Simulation

DSSimulation is a Discrete Event Simulation Instead of asking each agent to act(), we simply process events from a queue.

Author:
Mark Guzdial, Barb Ericson

Constructor Summary
DESimulation()
          No argument constructor
DESimulation(Picture bg)
          No argument constructor
 
Method Summary
 void addEvent(SimEvent newEvent)
          addEvent -- add an event to the queue
 double getTime()
          getTime -- return what time it is now.
 void log(String msg)
          Log something -- write to the console or interactions pane, And to the output file, if it exists.
 void run(double stopTime)
          Run until a certain time step is reached, by calling setUp (which we hope creates the base agents and schedules the first round of events), then repeatedly processing an event from the eventQueue.
 
Methods inherited from class Simulation
add, closeFile, endStep, getAgents, getOutput, getWorld, openFile, openFrames, remove, run, run, setUp, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DESimulation

public DESimulation()
No argument constructor


DESimulation

public DESimulation(Picture bg)
No argument constructor

Method Detail

getTime

public double getTime()
getTime -- return what time it is now.


addEvent

public void addEvent(SimEvent newEvent)
addEvent -- add an event to the queue

Parameters:
newEvent - the event to add

log

public void log(String msg)
Log something -- write to the console or interactions pane, And to the output file, if it exists.

Parameters:
msg - the message to write

run

public void run(double stopTime)
Run until a certain time step is reached, by calling setUp (which we hope creates the base agents and schedules the first round of events), then repeatedly processing an event from the eventQueue.

Parameters:
stopTime - the time to stop