rtgym.dataclass package

Submodules

rtgym.dataclass.agent_state module

class AgentState(coord: numpy.ndarray | None = None, hd: numpy.ndarray | None = None, disp: numpy.ndarray | None = None)[source]

Bases: object

Agent state data container for a single timestep.

Holds the state data of the agent including coordinates, head directions, and displacements. This represents a snapshot of the agent’s state at a single timestep and can hold multiple batches of data.

Parameters:
  • coord (np.ndarray, optional) – Integer coordinates of the agent.

  • hd (np.ndarray, optional) – Head direction of the agent in radians.

  • disp (np.ndarray, optional) – Displacement vector of the agent.

Raises:

ValueError – If all input parameters are None.

Note

For unknown values, use np.nan as placeholder. This data class helps standardize the data format for all sensory modalities.

property float_coord
property int_coord

rtgym.dataclass.raw_agent_state module

class RawAgentState(coord=None, hd=None, mv_dir=None, disp=None, vel_norm=None, drift=None)[source]

Bases: object

This is the data class specifically designed to store the behavior generation state.

property batch_size
copy()[source]
property float_coord
property int_coord
reset()[source]
to_agent_state()[source]

Cast this internal state to a regular agent state.

rtgym.dataclass.raw_trajectory module

class RawTrajectory(dur_ts: int | None = None, batch_size: int | None = None)[source]

Bases: object

append(bhv_state: RawAgentState)[source]
to_trajectory()[source]
update_state(ts, bhv_state: RawAgentState)[source]

rtgym.dataclass.trajectory module

class Trajectory(coord: numpy.ndarray | None = None, disp: numpy.ndarray | None = None, hd: numpy.ndarray | None = None)[source]

Bases: object

Class to hold trial data for the agent. This class is used to store the coordinates, coordinates in float, and head directions of the agent.

property coord
copy()[source]

Returns a copy of the Trajectory object.

property float_coord
classmethod from_dict(state_dict)[source]
property int_coord
static load(path)[source]

Load a Trajectory object from a file.

Parameters:

path (str) – The file path to load the Trajectory object from.

Returns:

A Trajectory object loaded from the specified file.

Return type:

Trajectory

property n_steps

Returns the number of time steps in the trajectory.

reshape(shape)[source]

Reshape the trajectory data to the specified shape.

slice(start, end)[source]
state_dict()[source]
t_range(range_)[source]

Returns a new Trajectory object with data trimmed to the specified range.

Parameters:

range (list or tuple) – A 2-element list or tuple specifying the start and end indices for trimming.

Returns:

A new Trajectory object with trimmed data.

Return type:

Trajectory

Module contents