ix.isim
Class ISimEngine

java.lang.Object
  extended by java.lang.Thread
      extended by ix.isim.ISimEngine
All Implemented Interfaces:
java.lang.Runnable

public class ISimEngine
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
(package private) static Symbol executeWithSy
          the annotation "predicate" that tells the simulation which class to invoke to simulate an action
protected  ISimEventsFrame simEventsFrame
          the Frame for displaying the events etc.
protected  ISim theISim
          the ISim to which this ISimEngine belongs
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ISimEngine(ISim isim)
          public constructor just memorizes theISim agent this engine belongs to
 
Method Summary
 void clearAllWaitingEvents()
           
 void executeNextEvent()
           
 long getSimStartTime()
          This function returns the the simulated time at which the simulation was started.
 void loadTimedEvents(java.io.File[] eventFiles)
          This function loads the timed events from the given Files.
 void pauseSimulation()
           
 void resumeSimulation()
           
 void run()
           
 void startSimulation(long simTime, double factor)
           
protected  void updateStatus(TimedEvent event, int status)
           
protected  void updateUI()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

executeWithSy

static final Symbol executeWithSy
the annotation "predicate" that tells the simulation which class to invoke to simulate an action


theISim

protected ISim theISim
the ISim to which this ISimEngine belongs


simEventsFrame

protected ISimEventsFrame simEventsFrame
the Frame for displaying the events etc.

Constructor Detail

ISimEngine

public ISimEngine(ISim isim)
public constructor just memorizes theISim agent this engine belongs to

Parameters:
isim - the ISim that owns this simulation engine
Method Detail

getSimStartTime

public long getSimStartTime()
This function returns the the simulated time at which the simulation was started.

Returns:
long initial simulated time

loadTimedEvents

public void loadTimedEvents(java.io.File[] eventFiles)
This function loads the timed events from the given Files. Times are interpreted as relative to the start time of the simulation if it hasn't started yet; otherwise they will be relative to the current sim-time.

Parameters:
events - the Files containing the timed events

startSimulation

public void startSimulation(long simTime,
                            double factor)

updateUI

protected void updateUI()

updateStatus

protected void updateStatus(TimedEvent event,
                            int status)

pauseSimulation

public void pauseSimulation()

resumeSimulation

public void resumeSimulation()

clearAllWaitingEvents

public void clearAllWaitingEvents()

executeNextEvent

public void executeNextEvent()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread