rtgym.arena.arena_shapes package
Submodules
rtgym.arena.arena_shapes.circle module
- generate_circle_arena(sr, **kwargs)[source]
Generate a circular arena with a border around it.
Creates a circular arena map where the interior is free space (0) and the exterior and border are walls (1).
- Parameters:
sr (float) – Spatial resolution of the arena in units per pixel.
**kwargs – Arena parameters including: radius (float): Radius of the circle in spatial units. Defaults to 50.
- Returns:
Arena map where 0 represents free space and 1 represents walls.
- Return type:
np.ndarray
rtgym.arena.arena_shapes.cornered_rectangle module
- generate_cornered_rectangle_arena(sr, **kwargs)[source]
Generate a rectangular arena with blocked corners.
Creates a rectangular arena where the four corners are blocked by walls, creating a rounded rectangular navigation space. Useful for studying boundary effects and corner navigation strategies.
- Parameters:
sr (float) – Spatial resolution of the arena in units per pixel.
**kwargs – Arena parameters including: width (float): Width of the rectangle in spatial units. Defaults to 100. height (float): Height of the rectangle in spatial units. Defaults to 100. corner (float): Size of corner blocks in spatial units. Defaults to 15.
- Returns:
Arena map where 0 represents free space and 1 represents walls.
- Return type:
np.ndarray
- Raises:
AssertionError – If corner size is too large for the arena dimensions.
rtgym.arena.arena_shapes.maze_0 module
- generate_maze_0_arena(sr, **kwargs)[source]
Generate a four-room maze arena with connecting tunnels.
Creates a maze with four square rooms connected by tunnels in a cross pattern. Each room is positioned at one corner of the maze.
- Parameters:
sr (float) – Spatial resolution of the arena in units per pixel.
**kwargs – Arena parameters including: room_width (float): Width of each room in spatial units. Defaults to 100. room_distance (float): Distance between opposite rooms. Defaults to 50. tunnel_width (float): Width of connecting tunnels. Defaults to 20. vertical (bool): Whether to rotate the maze 90 degrees.
- Returns:
Arena map where 0 represents free space and 1 represents walls.
- Return type:
np.ndarray
rtgym.arena.arena_shapes.maze_1 module
- generate_maze_1_arena(sr, **kwargs)[source]
Generate a complex multi-room maze arena.
Creates a maze with 7 interconnected rooms of various sizes connected by tunnels. This is a complex navigation environment for spatial tasks.
- Parameters:
sr (float) – Spatial resolution of the arena in units per pixel.
**kwargs – Arena parameters including: vertical (bool): Whether to rotate the maze 90 degrees.
- Returns:
Arena map where 0 represents free space and 1 represents walls.
- Return type:
np.ndarray
rtgym.arena.arena_shapes.maze_2 module
- generate_maze_2_arena(sr, **kwargs)[source]
Generate a complex maze with rooms, tunnels, and dead ends.
Creates an intricate maze with multiple rooms connected by tunnels, including dead ends and a circular path area. Designed for complex navigation experiments.
- Parameters:
sr (float) – Spatial resolution of the arena in units per pixel.
**kwargs – Arena parameters (currently unused).
- Returns:
Arena map where 0 represents walls and 1 represents free space.
- Return type:
np.ndarray
Note
This maze uses inverted logic where 1 is free space and 0 is walls, unlike other arena generators.
rtgym.arena.arena_shapes.rectangle module
- generate_rectangle_arena(sr, **kwargs)[source]
Generate a rectangular arena with a border around it.
Creates a rectangular arena map where the interior is free space (0) and the border is walls (1).
- Parameters:
sr (float) – Spatial resolution of the arena in units per pixel.
**kwargs –
Arena parameters including: dimensions (list): List of [width, height] dimensions in spatial units.
Defaults to [100, 100].
- Returns:
Arena map where 0 represents free space and 1 represents walls.
- Return type:
np.ndarray
- Raises:
AssertionError – If dimensions is not a list of 2 elements.
rtgym.arena.arena_shapes.trainer_0 module
- generate_trainer_0_arena(sr, **kwargs)[source]
rtgym.arena.arena_shapes.triangle module
- generate_triangle_arena(sr, **kwargs)[source]
- point_in_triangle(p, p0, p1, p2)[source]
rtgym.arena.arena_shapes.two_rooms module
- generate_two_rooms_arena(sr, **kwargs)[source]
Generate a two-room arena connected by a tunnel.
Creates two rectangular rooms connected by a narrow tunnel in the middle. This is a classic environment for studying spatial navigation between distinct compartments.
- Parameters:
sr (float) – Spatial resolution of the arena in units per pixel.
**kwargs – Arena parameters including: room_width (float): Width of each room in spatial units. Defaults to 70. room_height (float): Height of rooms in spatial units. Defaults to 70. room_distance (float): Distance between rooms. Defaults to 30. tunnel_width (float): Width of connecting tunnel. Defaults to 20. vertical (bool): Whether to rotate the arena 90 degrees.
- Returns:
Arena map where 0 represents free space and 1 represents walls.
- Return type:
np.ndarray