Probes#
#include "navground/sim/probe.h"
The base class for all probes.
Probes are callbacks called at the begin, at the end, and during each simulation step of an ExperimentalRun.
Concrete classes should overwrite prepare, update, and/or finalize as the base class does nothing.
Subclassed by navground::sim::GroupRecordProbe, navground::sim::RecordProbe, navground::sim::SensingProbe
Public Functions
Called at the begin of a simulation run.
- Parameters:
run – [in] The run
Called at each simulation step.
- Parameters:
run – [in] The run
Called at end of a simulation run.
- Parameters:
run – [in] The run
Base class for probes that records numerical data on a single dataset, possibly to be saved in HDF5.
Subclasses are expected to overwrite Probe::update, get_shape and to redefine RecordProbe::Type.
Public Types
The type of data to record. Subclasses must define their own type for ExperimentalRun::add_record_probe<T> to work with them.
Public Functions
Gets the item shape that the record should use, see Dataset::set_item_shape.
Subclasses should overwrite it to configure their records.
- Parameters:
world – [in] The world being simulated
- Returns:
The shape
Gets the data.
- Returns:
The data.
Base class for probes that record a group of datasets, possibly to be saved in HDF5. Records are keyed by strings.
Sub-classes are expected to override Probe::update, get_shapes and to redefine Type.
Public Types
The type of data to record. Subclasses must define their own type for ExperimentalRun::add_group_record_probe<T> to work with them.
Generates dataset for a given key
A map of shapes.
Public Functions
Gets the item shapes that the records should use, see Dataset::set_item_shape.
Subclasses should overwrite it to configure their records.
- Parameters:
world – [in] The world being simulated
use_agent_uid_as_key – [in] Whether to use the agent uid a key. If not set, it will use the the agent index instead.
- Returns:
The shapes
Gets the recorded data, possibly after instanting a dataset if none is yet associated to the key.
- Parameters:
key – [in] The key
- Returns:
The data.
A concrete probe to record readings from a specific sensor.
Public Types
{agent index -> {field name -> Dataset}}
Public Functions
Gets the stored sensor readings, indexed by UID or index.
- Returns:
The data.