rtgym.agent package
Subpackages
- rtgym.agent.behavior package
- rtgym.agent.sensory package
- Subpackages
- rtgym.agent.sensory.movement_modulated package
- Submodules
- rtgym.agent.sensory.movement_modulated.direction_cell module
- rtgym.agent.sensory.movement_modulated.direction_rad module
- rtgym.agent.sensory.movement_modulated.displacement_abs module
- rtgym.agent.sensory.movement_modulated.head_direction_cell module
- rtgym.agent.sensory.movement_modulated.mm_base module
- rtgym.agent.sensory.movement_modulated.speed_cell module
- Module contents
- rtgym.agent.sensory.spatial_modulated package
- Submodules
- rtgym.agent.sensory.spatial_modulated.boundary_cell module
- rtgym.agent.sensory.spatial_modulated.grid_cell module
- rtgym.agent.sensory.spatial_modulated.place_cell module
- rtgym.agent.sensory.spatial_modulated.sm_base module
- rtgym.agent.sensory.spatial_modulated.weak_sm_cell module
- Module contents
- rtgym.agent.sensory.movement_modulated package
- Submodules
- rtgym.agent.sensory.sensory module
SensorySensory.add_sensory()Sensory.aggregate_res_maps()Sensory.arenaSensory.common_paramsSensory.compute_res()Sensory.decode_response()Sensory.filter_sensories()Sensory.get_response()Sensory.init_from_profile()Sensory.list_all()Sensory.load()Sensory.load_from_state_dict()Sensory.num_sensories()Sensory.s_resSensory.save()Sensory.t_res
- Module contents
- Subpackages
Submodules
rtgym.agent.agent module
- class Agent(gym)[source]
Bases:
objectThe class object of the Agent. An agent represents the subject that navigates or traverses the arena, either randomly or under control. This implementation manages two central aspects: how the agent generates trajectories through the environment, and how different sensory systems or spatial navigation cell types might respond along those trajectories.
The Agent can be thought of as a virtual animal whose movement and sensory inputs can be precisely controlled and observed. In this setting, theoretical models of spatially tuned cells—such as place cells, grid cells, or head direction cells—can be applied to predict how each of them would respond given the positions visited along a trajectory.
The Agent acts as a unifying interface that combines behavioral rules with sensory transformations, enabling reproducible experiments where navigation and perception are directly linked.
The Agent is coupled to a gym environment that defines the arena, spatial and temporal resolution, and the overall rules of the task. Through this interface, the Agent can be spawned at specific or random locations, controlled step by step, or allowed to move autonomously, while its sensory responses can be queried from individual states or full trajectories.
- Parameters:
gym (RatatouGym) – The parent gym environment.
behavior_profile (dict) – Current behavior configuration.
sensory_profile (dict) – Current sensory configuration.
sensory (Sensory) – Sensory system manager.
behavior (Behavior) – Behavior system manager.
- add_sensory(sensory_profile)[source]
Add sensory modalities to existing configuration.
- Parameters:
sensory_profile (dict) – Additional sensory configuration parameters.
- property autonomous
Get autonomous behavior system.
- Returns:
Autonomous behavior manager.
- Return type:
- property controllable
Get controllable behavior system.
- Returns:
Controllable behavior manager.
- Return type:
- get_response(agent_data: AgentState | Trajectory, return_format='array', keys=None, str_filter=None, type_filter=None)[source]
- random_spawn(batch_size: int)[source]
Spawn the controller at a random position in the arena.
- random_traverse(duration: float, batch_size: int, init_pos=None, init_state=None, pause_prob=0)[source]
- property sensories
Get all sensory modalities.
- Returns:
Dictionary of sensory modalities keyed by name.
- Return type:
dict
- set_behavior(behavior_profile)[source]
Set behavior configuration.
- Parameters:
behavior_profile (dict) – Behavior configuration parameters.
- set_sensory(sensory_profile)[source]
Set sensory configuration.
- Parameters:
sensory_profile (dict) – Sensory configuration parameters.
- set_sensory_manually(sens_type, sens)[source]
- property spatial_resolution
Get spatial resolution from gym.
- Returns:
Spatial resolution in units per pixel.
- Return type:
float
- spawn(init_pos=None, init_state=None)[source]
Spawn the controllable agent at the given position and state.
Resets the controllable behavior and initializes the agent at a specific location and state for manual control.
- Parameters:
init_pos (np.ndarray, optional) – Initial position of the agent.
init_state (AgentState or RawAgentState, optional) – Initial state of the agent. If both init_pos and init_state are provided, init_state will be used.
- step(displacement)[source]