public class SimulationManager extends Object implements Runnable
AutomatonNodes of the AutomatonGraph. As a standard
implementation there is the FlatUpdateRecorder 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(bio.singa.core.events.UpdateEventListener<GraphUpdatedEvent> listener)
Adds a new listener for graph based events.
|
void |
addNodeUpdateListener(bio.singa.core.events.UpdateEventListener<UpdatableUpdatedEvent> listener)
Adds a new listener for node based events.
|
void |
emitGraphEvent(Simulation simulation) |
void |
emitNodeEvent(Simulation simulation,
Updatable updatable) |
CopyOnWriteArrayList<bio.singa.core.events.UpdateEventListener<GraphUpdatedEvent>> |
getGraphListeners() |
CopyOnWriteArrayList<bio.singa.core.events.UpdateEventListener<UpdatableUpdatedEvent>> |
getNodeListeners()
Returns all currently registered node event listeners.
|
Simulation |
getSimulation()
Returns the simulation.
|
SimulationStatus |
getSimulationStatus() |
boolean |
keepPlatformOpen() |
void |
run() |
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.
|
public SimulationManager(Simulation simulation)
simulation - The simulation.public void addNodeUpdateListener(bio.singa.core.events.UpdateEventListener<UpdatableUpdatedEvent> listener)
listener - The listener.public CopyOnWriteArrayList<bio.singa.core.events.UpdateEventListener<UpdatableUpdatedEvent>> getNodeListeners()
public void addGraphUpdateListener(bio.singa.core.events.UpdateEventListener<GraphUpdatedEvent> listener)
listener - The listener.public CopyOnWriteArrayList<bio.singa.core.events.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 SimulationStatus getSimulationStatus()
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()
Copyright © 2019. All rights reserved.