|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectadevs.Simulator
public class Simulator
This is a wrapper around the C++ Simulator class. It is used in exactly the same way. The Java version of this simulator does not support parallel simulation (yet). Also be aware that there is no support (yet) for exceptions thrown either by the C++ Simulator or by the models when their methods are invoked by the Simulator; so please be careful.
Constructor Summary | |
---|---|
Simulator(Devs model)
Creates a simulator for an Atomic or Network model. |
Method Summary | |
---|---|
void |
addEventListener(EventListener l)
Register a listener to receive callbacks when output and changes in state occur. |
void |
computeNextOutput()
Compute the output at the time of the next internal event. |
void |
computeNextState(java.util.Collection<Event> input,
double t)
Inject input into the model at the specified time. |
void |
dispose()
Release the native resources used by this simulator. |
void |
execNextEvent()
Compute the output and next state at the next event time. |
void |
execUntil(double tend)
Simulate until nextEventTime() is greater than tend. |
protected void |
finalize()
Finalizer deletes native resources if they have not already been taken care of by a call to dispose(). |
double |
nextEventTime()
Get the time of the model's next event. |
void |
removeEventListener(EventListener l)
Unregister a listener so that it will not receive callbacks from the simulator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Simulator(Devs model)
model
- The Network or Atomic model that you want to simulateAtomic
Method Detail |
---|
public double nextEventTime()
public void execNextEvent()
EventListener
public void execUntil(double tend)
tend
- time to stop the simulationEventListener
public void computeNextOutput()
EventListener
public void computeNextState(java.util.Collection<Event> input, double t)
input
- The values to inject and the target modelst
- Time to apply the inputEvent
public void addEventListener(EventListener l)
l
- The listener to register with the simulatorEventListener
public void removeEventListener(EventListener l)
l
- The listener to unregisterEventListener
public void dispose()
protected void finalize()
finalize
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |