public class SimulationManager extends javafx.concurrent.Task<Simulation>
AutomatonNodes of the AutomatonGraph. As a standard
implementation there is the EpochUpdateWriter that can be added to the Simulation that will write log files
to the specified file locations.| Constructor and Description |
|---|
SimulationManager(Simulation simulation)
Creates a new simulation manager for the given simulation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGraphUpdateListener(UpdateEventListener<GraphUpdatedEvent> listener)
Adds a new listener for graph based events.
|
void |
addNodeUpdateListener(UpdateEventListener<UpdatableUpdatedEvent> listener)
Adds a new listener for node based events.
|
protected Simulation |
call() |
protected void |
done() |
void |
emitGraphEvent(Simulation simulation) |
void |
emitNodeEvent(Simulation simulation,
Updatable updatable) |
CopyOnWriteArrayList<UpdateEventListener<GraphUpdatedEvent>> |
getGraphListeners() |
CopyOnWriteArrayList<UpdateEventListener<UpdatableUpdatedEvent>> |
getNodeListeners()
Returns all currently registered node event listeners.
|
Simulation |
getSimulation()
Returns the simulation.
|
boolean |
keepPlatformOpen() |
void |
setKeepPlatformOpen(boolean keepPlatformOpen) |
void |
setSimulationTerminationToEpochs(long numberOfEpochs)
Schedules the termination of the simulation after the given number of epochs have passed.
|
void |
setSimulationTerminationToTime(javax.measure.Quantity<javax.measure.quantity.Time> time)
Schedules the termination of the simulation after the given time (simulation time) has passed.
|
void |
setTerminationCondition(Predicate<Simulation> terminationCondition)
Sets a condition determining when the simulation should be terminated.
|
void |
setTerminationLatch(CountDownLatch terminationLatch) |
void |
setUpdateEmissionCondition(Predicate<Simulation> emitCondition)
Sets a condition determining when events should be emitted.
|
void |
setUpdateEmissionToTimePassed(javax.measure.Quantity<javax.measure.quantity.Time> timePassed)
Schedules the emission of events after the given time (simulation time) has passed.
|
void |
tieUpdateEmissionToFPS(int fps)
Sets the emission of updates for a rending engine.
|
addEventFilter, addEventHandler, buildEventDispatchChain, cancel, cancel, cancelled, exceptionProperty, failed, fireEvent, getException, getMessage, getOnCancelled, getOnFailed, getOnRunning, getOnScheduled, getOnSucceeded, getProgress, getState, getTitle, getTotalWork, getValue, getWorkDone, isRunning, messageProperty, onCancelledProperty, onFailedProperty, onRunningProperty, onScheduledProperty, onSucceededProperty, progressProperty, removeEventFilter, removeEventHandler, running, runningProperty, scheduled, setEventHandler, setOnCancelled, setOnFailed, setOnRunning, setOnScheduled, setOnSucceeded, stateProperty, succeeded, titleProperty, totalWorkProperty, updateMessage, updateProgress, updateProgress, updateTitle, updateValue, valueProperty, workDonePropertyget, get, isCancelled, isDone, run, runAndReset, set, setExceptionpublic SimulationManager(Simulation simulation)
simulation - The simulation.public void addNodeUpdateListener(UpdateEventListener<UpdatableUpdatedEvent> listener)
listener - The listener.public CopyOnWriteArrayList<UpdateEventListener<UpdatableUpdatedEvent>> getNodeListeners()
public void addGraphUpdateListener(UpdateEventListener<GraphUpdatedEvent> listener)
listener - The listener.public CopyOnWriteArrayList<UpdateEventListener<GraphUpdatedEvent>> getGraphListeners()
public void setTerminationCondition(Predicate<Simulation> terminationCondition)
terminationCondition - The termination condition.public void setSimulationTerminationToTime(javax.measure.Quantity<javax.measure.quantity.Time> time)
time - The time.public void setSimulationTerminationToEpochs(long numberOfEpochs)
numberOfEpochs - The number of epochs.public void setUpdateEmissionCondition(Predicate<Simulation> emitCondition)
emitCondition - The emission condition.public void tieUpdateEmissionToFPS(int fps)
fps - The frames (emits) per (real time) second.public void setUpdateEmissionToTimePassed(javax.measure.Quantity<javax.measure.quantity.Time> timePassed)
timePassed - The (simulation) time passed.public void setTerminationLatch(CountDownLatch terminationLatch)
public void emitGraphEvent(Simulation simulation)
public void emitNodeEvent(Simulation simulation, Updatable updatable)
public boolean keepPlatformOpen()
public void setKeepPlatformOpen(boolean keepPlatformOpen)
public Simulation getSimulation()
protected Simulation call()
call in class javafx.concurrent.Task<Simulation>protected void done()
done in class FutureTask<Simulation>Copyright © 2019. All rights reserved.