|
Dynamic Neural Field Composer 0.0.0
A C++20 library and interactive application for building and simulating Dynamic Neural Field (DNF) architectures.
|
Manages ongoing time-series recordings and snapshot exports of element component data for a simulation. More...
#include <simulation_recorder.h>
Public Member Functions | |
| bool | hasActiveRecordings () const |
| Return true if at least one recording session is active. | |
| bool | isRecording (const std::string &elementId, const std::string &componentName) const |
| Return true if a recording is currently active for the given pair. | |
| void | startRecording (const std::string &simName, const std::string &elementId, const std::string &componentName, int sampleInterval, RecordingIntervalUnit unit) |
Start a new continuous recording for the given element/component pair. Creates data/<simName>/recordings/<elementId>_<componentName>_<timestamp>.csv and writes the header row. No-op if an identical recording is already active. | |
| void | stopAll () |
| Stop all active recordings and close all open files. | |
| void | stopRecording (const std::string &elementId, const std::string &componentName) |
| Stop the recording for a specific element/component pair. The CSV file is closed and the session is removed. No-op if not recording. | |
| void | takeSnapshot (const std::string &simName, const std::string &elementId, const std::string &componentName, const Simulation &sim) |
Write a single-row snapshot CSV for the given element/component. Output path: data/<simName>/exports/<elementId>_<componentName>_<timestamp>.csv | |
| void | update (const Simulation &sim) |
Called each simulation step to append rows to active recordings. Ticks are derived from sim.t, sim.tZero, and sim.deltaT. | |
Manages ongoing time-series recordings and snapshot exports of element component data for a simulation.
Recordings write rows to a CSV file at data/<simName>/recordings/ each time the configured sample interval elapses. Snapshots write a single row to data/<simName>/exports/.
CSV format — for 1D elements: header ticks,ms,0,1,...,N-1; data rows <ticks>,<ms>,<v0>,.... For 2D elements a # size_x=W,size_y=H comment line precedes the header so readers can reshape the flat row-major columns back into a 2D grid.
| bool dnf_composer::SimulationRecorder::hasActiveRecordings | ( | ) | const |
Return true if at least one recording session is active.
| bool dnf_composer::SimulationRecorder::isRecording | ( | const std::string & | elementId, |
| const std::string & | componentName | ||
| ) | const |
Return true if a recording is currently active for the given pair.
| void dnf_composer::SimulationRecorder::startRecording | ( | const std::string & | simName, |
| const std::string & | elementId, | ||
| const std::string & | componentName, | ||
| int | sampleInterval, | ||
| RecordingIntervalUnit | unit | ||
| ) |
Start a new continuous recording for the given element/component pair. Creates data/<simName>/recordings/<elementId>_<componentName>_<timestamp>.csv and writes the header row. No-op if an identical recording is already active.
| simName | Simulation unique identifier (used as the sub-folder name). |
| elementId | Unique name of the element to record. |
| componentName | Name of the component vector (e.g. "activation"). |
| sampleInterval | How often to sample (in the chosen unit). |
| unit | Whether sampleInterval is in ticks or milliseconds. |
| void dnf_composer::SimulationRecorder::stopAll | ( | ) |
Stop all active recordings and close all open files.
| void dnf_composer::SimulationRecorder::stopRecording | ( | const std::string & | elementId, |
| const std::string & | componentName | ||
| ) |
Stop the recording for a specific element/component pair. The CSV file is closed and the session is removed. No-op if not recording.
| elementId | Unique name of the element. |
| componentName | Name of the component. |
| void dnf_composer::SimulationRecorder::takeSnapshot | ( | const std::string & | simName, |
| const std::string & | elementId, | ||
| const std::string & | componentName, | ||
| const Simulation & | sim | ||
| ) |
Write a single-row snapshot CSV for the given element/component. Output path: data/<simName>/exports/<elementId>_<componentName>_<timestamp>.csv
| simName | Simulation unique identifier. |
| elementId | Unique name of the element. |
| componentName | Name of the component. |
| sim | The simulation (used to read the component and current time). |
| void dnf_composer::SimulationRecorder::update | ( | const Simulation & | sim | ) |
Called each simulation step to append rows to active recordings. Ticks are derived from sim.t, sim.tZero, and sim.deltaT.
| sim | The simulation whose components are being recorded. |