Class FlatUpdateRecorder
- java.lang.Object
-
- bio.singa.simulation.trajectories.flat.FlatUpdateRecorder
-
- All Implemented Interfaces:
bio.singa.core.events.UpdateEventListener<UpdatableUpdatedEvent>
public class FlatUpdateRecorder extends Object implements bio.singa.core.events.UpdateEventListener<UpdatableUpdatedEvent>
This class can be used to write the concentration of chemical entities of a node and the changes applied to the node to a file. The updates are written each time a event is received. The events can be scheduled by using theSimulationManager.setUpdateEmissionCondition(Predicate). A node is observed by callingaddUpdatableToObserve(Updatable).- Author:
- cl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFlatUpdateRecorder.BuildStepstatic interfaceFlatUpdateRecorder.ConcentrationUnitStepstatic interfaceFlatUpdateRecorder.DirectoryStepstatic classFlatUpdateRecorder.EpochUpdateWriterBuilderstatic interfaceFlatUpdateRecorder.SimulationStepstatic interfaceFlatUpdateRecorder.TimeUnitStepstatic interfaceFlatUpdateRecorder.WorkspaceStep
-
Constructor Summary
Constructors Constructor Description FlatUpdateRecorder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUpdatableToObserve(Updatable updatable)Initializes a updatable that will be observed during simulation.voidcloseWriters()Close all associated writers.static FlatUpdateRecorder.WorkspaceStepcreate()PathgetWorkspaceFolder()voidonEventReceived(UpdatableUpdatedEvent event)
-
-
-
Method Detail
-
create
public static FlatUpdateRecorder.WorkspaceStep create()
-
getWorkspaceFolder
public Path getWorkspaceFolder()
-
addUpdatableToObserve
public void addUpdatableToObserve(Updatable updatable) throws IOException
Initializes a updatable that will be observed during simulation. Also prepares the files that will be written during simulation.- Parameters:
updatable- The updatable to be observed.- Throws:
IOException- If the file can not be created.
-
closeWriters
public void closeWriters()
Close all associated writers. Usually called after simulation finishes.
-
onEventReceived
public void onEventReceived(UpdatableUpdatedEvent event)
- Specified by:
onEventReceivedin interfacebio.singa.core.events.UpdateEventListener<UpdatableUpdatedEvent>
-
-