public class Simulator
extends java.lang.Object
Constructor and Description |
---|
Simulator(Devs model)
Creates a simulator for an Atomic or Network model.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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