Recorded Experiments#
Recorded Run#
A recorded experimental run.
All data is loaded from a HDF5 group and served with the same getter methods and attributes as
navground.sim.ExperimentalRun
but limited to read-only. All setters are explicitly blocked.It holds a
navground.sim.World
. At initialization, the world is set to the state at the begin of the recorded run. By repeatedly callingdo_step()
, the world can be advanced, setting the state according to the data stored in the HDF5 group.Constructs a new instance.
- Parameters:
group – The HDF5 group recorded by a
navground.sim.ExperimentalRun
Try to advance the world by one recorded simulation step, see
go_to_step()
.- Returns:
True if the operation was possible and False otherwise.
Gets the recorded collisions events, i.e. collisions separated by more than min_interval steps
- Parameters:
min_interval – The minimal interval between collision among the same pair to be considered a new event
- Returns:
A dataset of shape {#events, 4} of events <begin, end, e1, e2>
Gets recorded data.
- Parameters:
group (str) – the name of the record
- Returns:
recorded dataset or None if no data has been recorded for the given key
Gets the names of records.
- Parameters:
group (str) – An optional group. If specified, the looks for record associated to keys
<group>/...
.- Returns:
The record names (relative to the group if specified).
Gets recorded data map.
- Parameters:
group – if specified, limits to records in a given group.
- Returns:
recorded datasets indexed by their key (relative to the group if specified).
Gets the steps to the next recorded collision for each agent at each simulation step.
- Parameters:
min_interval – The minimal interval between collision among the same pair to be considered a new event
- Returns:
An array of shape {#steps, #agents}
The recorded events logged by the task of an agent as a HDF5 dataset of shape
(number events, size of event log)
and dtypefloat
:[[data_0, ...], ...]
The dataset is empty if the agent’s task has not been recorded in the run.
- Parameters:
agent – The agent
- Returns:
The events logged by the agent task
Try to advance the world to a given recorded simulation step.
Depending if the data has been recorded, it will update:
- Returns:
True if the operation was possible and False otherwise.
Associate an index to a given agent.
Data related to agents is stored in this order. For example, poses at a given time step are stored as
[[x_0, y_0, z_0], [x_1, y_1, z_1], ...]
where the pose of agent a is at the index returned by this function.
- Parameters:
agent – The agent
- Returns:
The index of data related to this agent or -1 if not found.
Reset the run to the state at the begin of the recorded run.
Gets the rectangle that contains the world during the whole run.
Computes the rectangle in which agents are contained during the run:
(lower-left corner, top-right corner)
orNone
if no poses has been recorded
The recorded collisions
The recorded commands
The recorded deadlocks
The duration of the run
The recorded efficacy
Determines if play back has finished:
True
if there are no more steps to play back,False
otherwise
The maximal steps that could have been performed
The number of agents recorded
The recorded poses
All recorded dataset names
The actual number of steps that have been performed
All recorded datasets
The run root HDF5 group
The recorded safety violations
The seed used during to initialize the world and during the run
The recorded task events
The recorded targets
The sensing state
The time step used by the simulation
The recorded times
The recorded twists
The world that has been simulated
Recorded Experiment#
A recorded experiment.
All data is loaded from a HDF5 recorded by
navground.sim.Experiment
, and served with the same getter methods and attributes asnavground.sim.Experiment
but limited to read-only.All setters are explicitly blocked.
Constructs a new instance.
- Parameters:
path – An optional path to the HDF5 file to load
file – An optional HDF5 file. When not specified, the file is loaded from the path.
The time stamp of the experiment
The duration of the experiment
Set to
True
: the experiment is no more running
Set to
False
: the experiment is no more running
The experiment name
The number of runs that the experiment should have performed
The path of the HDF5 file
The record config used by the experiment
The first seed/index
The recorded runs, indexed by their seed
Where the experiment saved its result
The scenario of the experiment
The maximal steps performed by the experiment