Class Simulator

java.lang.Object
   |
   +----Simulator

public class Simulator
extends Object
A generic simulation class. subclass this class to customize a simulator


Variable Index

 o globalClock
 o timeSlice

Constructor Index

 o Simulator()

Method Index

 o addEvent(SimEvent)
insert a future event in the event queue
 o addEventGenerator(EventGenerator)
add a event generator to this simulator
 o addRelativeEvent(SimEvent)
insert a future event in the event queue the time specified in the event is relative to the global time
 o getNetwork()
override this method to access the Network object
 o getTime()
 o processEvent(SimEvent)
override this method to see all events that pass through the simulator
 o queueElements()
 o removeEvent(SimEvent)
 o removeEvents(Object)
 o setStopTime(int)
 o start()
call this method to start the simulation
 o stop()
override this method to perform some action when the simulation has stopped

Variables

 o globalClock
 public float globalClock
 o timeSlice
 public float timeSlice

Constructors

 o Simulator
 public Simulator()

Methods

 o addEventGenerator
 public void addEventGenerator(EventGenerator eg)
add a event generator to this simulator

Parameters:
eg - the EventGenerator to add
See Also:
EventGenerator
 o addEvent
 public void addEvent(SimEvent e)
insert a future event in the event queue

 o addRelativeEvent
 public void addRelativeEvent(SimEvent e)
insert a future event in the event queue the time specified in the event is relative to the global time

 o removeEvent
 public SimEvent removeEvent(SimEvent e)
 o removeEvents
 public void removeEvents(Object o)
 o queueElements
 public Enumeration queueElements()
 o processEvent
 public void processEvent(SimEvent e)
override this method to see all events that pass through the simulator

 o getNetwork
 public Network getNetwork()
override this method to access the Network object

 o start
 public void start()
call this method to start the simulation

 o stop
 public void stop()
override this method to perform some action when the simulation has stopped

 o getTime
 public float getTime()
Returns:
the current global time
 o setStopTime
 public void setStopTime(int t)