Skip to main content

Memory Maze environments with DrStrategy enhancements for reinforcement learning research

Project description

Memory Maze DrStrategy Environments

Goal-conditioned maze navigation environments adapted from Memory-Maze with visual enhancements from DrStrategy.

Environments

7×7 Complex Maze 15×15 Complex Maze
cmaze 7x7 cmaze 15x15
Environment ID Grid Episode Steps Description
MemoryMaze-cmaze-7x7-drstrategy-v0 7×7 500 Compact complex maze with colorful textures
MemoryMaze-cmaze-15x15-drstrategy-v0 15×15 1000 Large complex maze with colorful textures

API

Observation Space (Dict)

The observation is a gymnasium.spaces.Dict with five keys:

Key Shape Dtype Description
image (64, 64, 3) uint8 First-person egocentric camera (HWC)
goal_image (64, 64, 3) uint8 Pre-rendered image of the current goal location
target_color (3,) float64 Goal sphere colour, RGB in [0, 1]
position (2,) float64 Agent position in maze coordinates
direction (2,) float64 Agent heading unit vector

Action Space

Continuous gymnasium.spaces.Box(shape=(2,)):

Index Meaning
action[0] Forward (negative) / Backward (positive)
action[1] Turn left (negative) / Turn right (positive)

Reward and Info

  • Reward: 1.0 when the goal is reached, 0.0 otherwise (sparse)
  • info["success"]: 1 on the step the goal is reached, 0 otherwise
  • info["distance"]: L1 distance to the current goal

Features

  • Colorful wall textures using the tab20 colormap, unique per maze section
  • Colorful floor textures using block-based tab20 colours
  • Goal-conditioned navigation: goal_image provides a pre-rendered first-person view from the target location
  • 20 distinct target sphere colours
  • Physics-based agent (rolling ball with friction)
  • Fixed maze layouts for reproducible experiments

Usage

Basic Example

import gymnasium as gym
import memory_maze

env = gym.make("MemoryMaze-cmaze-7x7-drstrategy-v0")
obs, info = env.reset()

for _ in range(500):
    action = env.action_space.sample()
    obs, reward, terminated, truncated, info = env.step(action)

    if terminated or truncated:
        obs, info = env.reset()

env.close()

Rendering Backend

Set the MUJOCO_GL environment variable before running:

export MUJOCO_GL=egl     # Hardware-accelerated (recommended)
export MUJOCO_GL=osmesa  # Software rendering for headless servers

Examples

  • examples/keyboard_control.py — Interactive 3-panel matplotlib window (obs / goal_image / top-down view), controlled with WASD keys
  • examples/save_observations_with_goals.py — Saves observations, all pre-rendered goal images, and the top-down view to disk

Installation

From Source

pip install -e .

Rendering Setup

export MUJOCO_GL=egl     # GPU systems
export MUJOCO_GL=osmesa  # Headless / CPU-only

Verify

import gymnasium as gym
import memory_maze

env = gym.make("MemoryMaze-cmaze-7x7-drstrategy-v0")
obs, info = env.reset()
print(obs["image"].shape)   # (64, 64, 3)
print(env.action_space)     # Box(-inf, inf, (2,), float64)
env.close()

Development

Code formatting uses black, isort, and ruff (configured in pyproject.toml). Run tests with pytest.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

color_memory_maze-1.0.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

color_memory_maze-1.0.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file color_memory_maze-1.0.0.tar.gz.

File metadata

  • Download URL: color_memory_maze-1.0.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for color_memory_maze-1.0.0.tar.gz
Algorithm Hash digest
SHA256 55e6ce65d336ea9d5588fd4a5c0d77cb2026aedef7a36b6907a1104d4b503a96
MD5 8e3117a6239495afbd655f1281e63814
BLAKE2b-256 4c22ae39806d9d05843987445d0dde963f53ecb605d3a7a23b535f1566834e43

See more details on using hashes here.

Provenance

The following attestation bundles were made for color_memory_maze-1.0.0.tar.gz:

Publisher: publish.yml on mctigger/color-memory-maze

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file color_memory_maze-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for color_memory_maze-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9bb6953975f1c0d5198c9294b747f75eed626d14ff7bd8e0d3c97cec90e3a9e
MD5 08c2e3e76a533dcade29b62735d45ffb
BLAKE2b-256 e0bd81c3d61d99d07a854d65570087481cb71419f2cc98d03e77f7cf8809811a

See more details on using hashes here.

Provenance

The following attestation bundles were made for color_memory_maze-1.0.0-py3-none-any.whl:

Publisher: publish.yml on mctigger/color-memory-maze

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page