Dynamic Neural Field Composer 0.0.0
A C++20 library and interactive application for building and simulating Dynamic Neural Field (DNF) architectures.
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
dnf_composer::SimulationRecorder Class Reference

Manages ongoing time-series recordings and snapshot exports of element component data for a simulation. More...

#include <simulation_recorder.h>

Collaboration diagram for dnf_composer::SimulationRecorder:

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.
 

Detailed Description

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.

Member Function Documentation

◆ hasActiveRecordings()

bool dnf_composer::SimulationRecorder::hasActiveRecordings ( ) const

Return true if at least one recording session is active.

◆ isRecording()

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.

Here is the caller graph for this function:

◆ startRecording()

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.

Parameters
simNameSimulation unique identifier (used as the sub-folder name).
elementIdUnique name of the element to record.
componentNameName of the component vector (e.g. "activation").
sampleIntervalHow often to sample (in the chosen unit).
unitWhether sampleInterval is in ticks or milliseconds.
Here is the call graph for this function:

◆ stopAll()

void dnf_composer::SimulationRecorder::stopAll ( )

Stop all active recordings and close all open files.

Here is the caller graph for this function:

◆ stopRecording()

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.

Parameters
elementIdUnique name of the element.
componentNameName of the component.
Here is the call graph for this function:

◆ takeSnapshot()

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

Parameters
simNameSimulation unique identifier.
elementIdUnique name of the element.
componentNameName of the component.
simThe simulation (used to read the component and current time).
Here is the call graph for this function:

◆ update()

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.

Parameters
simThe simulation whose components are being recorded.
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: