src.canns.task.closed_loop_navigation

Classes

ClosedLoopNavigationTask

Closed-loop navigation task that incorporates real-time feedback from a controller.

TMazeClosedLoopNavigationTask

Closed-loop navigation task in a T-maze environment.

TMazeRecessClosedLoopNavigationTask

Closed-loop navigation task in a T-maze environment with recesses at stem-arm junctions.

Module Contents

class src.canns.task.closed_loop_navigation.ClosedLoopNavigationTask(start_pos=(2.5, 2.5), width=5, height=5, dimensionality='2D', boundary_conditions='solid', scale=None, dx=0.01, grid_dx=None, grid_dy=None, boundary=None, walls=None, holes=None, objects=None, dt=None, speed_mean=0.04, speed_std=0.016, speed_coherence_time=0.7, rotational_velocity_coherence_time=0.08, rotational_velocity_std=120 * np.pi / 180, head_direction_smoothing_timescale=0.15, thigmotaxis=0.5, wall_repel_distance=0.1, wall_repel_strength=1.0)[source]

Bases: src.canns.task.navigation_base.BaseNavigationTask

Closed-loop navigation task that incorporates real-time feedback from a controller.

In this task, the agent’s movement is controlled step-by-step by external commands rather than following a pre-generated trajectory.

Initializes the Task instance.

Parameters:

data_class (type, optional) – A dataclass type for structured data. If provided, the task will use this class to structure the loaded or generated data.

abstractmethod get_data()[source]

Abstract core method for data acquisition.

Subclasses must implement this method. Depending on the task type, the implementation could be: - Downloading and loading data from the web. - Reading data from the local filesystem. - Generating synthetic data in real-time.

After execution, this method should assign the processed data to self.data.

step_by_pos(new_pos)[source]
total_steps = 1[source]
class src.canns.task.closed_loop_navigation.TMazeClosedLoopNavigationTask(w=0.3, l_s=1.0, l_arm=0.75, t=0.3, start_pos=(0.0, 0.15), dt=None, **kwargs)[source]

Bases: ClosedLoopNavigationTask

Closed-loop navigation task in a T-maze environment.

This subclass configures the environment with a T-maze boundary, which is useful for studying decision-making and spatial navigation in a controlled setting.

Initialize T-maze closed-loop navigation task.

Parameters:
  • w – Width of the corridor (default: 0.3)

  • l_s – Length of the stem (default: 1.0)

  • l_arm – Length of each arm (default: 0.75)

  • t – Thickness of the walls (default: 0.3)

  • start_pos – Starting position of the agent (default: (0.0, 0.15))

  • dt – Time step (default: None, uses bm.get_dt())

  • **kwargs – Additional keyword arguments passed to ClosedLoopNavigationTask

class src.canns.task.closed_loop_navigation.TMazeRecessClosedLoopNavigationTask(w=0.3, l_s=1.0, l_arm=0.75, t=0.3, recess_width=None, recess_depth=None, start_pos=(0.0, 0.15), dt=None, **kwargs)[source]

Bases: TMazeClosedLoopNavigationTask

Closed-loop navigation task in a T-maze environment with recesses at stem-arm junctions.

This variant adds small rectangular indentations at the T-junction, creating additional spatial features that may be useful for studying spatial navigation and decision-making.

Initialize T-maze with recesses closed-loop navigation task.

Parameters:
  • w – Width of the corridor (default: 0.3)

  • l_s – Length of the stem (default: 1.0)

  • l_arm – Length of each arm (default: 0.75)

  • t – Thickness of the walls (default: 0.3)

  • recess_width – Width of recesses at stem-arm junctions (default: t/4)

  • recess_depth – Depth of recesses extending downward (default: t/4)

  • start_pos – Starting position of the agent (default: (0.0, 0.15))

  • dt – Time step (default: None, uses bm.get_dt())

  • **kwargs – Additional keyword arguments passed to ClosedLoopNavigationTask