Adding Environments
This guide explains how to add support for a new simulation environment to Maple.
Overview
Adding a new environment requires:
Creating a Docker image with the environment server
Implementing an environment backend class
Creating adapters for each supported policy
Step 1: Create Docker Image
Create docker/myenv/env_server.py with FastAPI endpoints:
GET /health- Health checkPOST /setup- Setup taskPOST /reset- Reset environmentPOST /step- Take action stepGET /tasks- List available tasks
Step 2: Create Backend Class
Create maple/backend/envs/myenv.py:
from maple.backend.envs.base import DockerEnvBackend
class MyEnvBackend(DockerEnvBackend):
name = "myenv"
IMAGE = "maple/myenv:latest"
CONTAINER_PORT = 8000
Register in maple/backend/envs/registry.py.
Step 3: Create Adapters
Create adapters for each policy you want to support with this environment.
See ../api/adapters for detailed documentation.