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.1.0.tar.gz (18.4 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.1.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: color_memory_maze-1.1.0.tar.gz
  • Upload date:
  • Size: 18.4 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.1.0.tar.gz
Algorithm Hash digest
SHA256 55a29eefe67407afe31f540ae052988da2d3727ac9161ca41e10bb26059780d3
MD5 7eb623acfd951d5eddb92efd3d4aea90
BLAKE2b-256 4b12cb41acd5aa1d675511f1fdc8084cbf763caf0cb1a39370f59cf546371897

See more details on using hashes here.

Provenance

The following attestation bundles were made for color_memory_maze-1.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for color_memory_maze-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de0ce2772e27c9a49738a06c22b77e2bf4091fe35065e62992b383de9c1a4857
MD5 a68574a712755fb5db8fcb04aeebc9bd
BLAKE2b-256 c7d7119a173b150e083aae46f015eba4765c32c37c927ee7cb160d1a94a0779d

See more details on using hashes here.

Provenance

The following attestation bundles were made for color_memory_maze-1.1.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