Class DESimulation

java.lang.Object
  extended bySimulation
      extended byDESimulation
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.


Field Summary
protected  EventQueue events
          Queue for Events
 double now
          current time
 
Fields inherited from class Simulation
agents, frames, output, world
 
Constructor Summary
DESimulation()
           
 
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 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, lineForFile, openFile, openFrames, remove, run, run, setUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

events

protected EventQueue events
Queue for Events


now

public double now
current time

Constructor Detail

DESimulation

public DESimulation()
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


log

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


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.