Skip to main content
This guide walks you through creating a Foundation environment, running a simulation loop, and inspecting observations and rewards.

Prerequisites

Make sure Foundation is installed:
See the Installation page for full setup instructions including conda environments and GPU support.

Create an environment

Foundation exposes make_env_instance() as the primary entry point for creating environments:

Available scenario names

Procedurally generated map with randomized resource placement.
Fixed map layout loaded from a .txt file.
Joint pandemic health and economic simulation. Requires activation code for real-world data mode.
Single-timestep labor and tax scenario for rapid RL experimentation.

Reset and inspect

1

Reset the environment

reset() returns a dictionary of observations keyed by agent index:
2

Inspect agents

Access agents directly from the environment:
3

Step the simulation

Pass an action dict keyed by agent index. Each value is the action index (or a dict in multi_action_mode):
4

Run a full episode

Controlling randomness

Use env.seed() to set reproducible seeds:

Examining the world

Next steps

Core Concepts

Understand Scenarios, Components, Agents, and Entities.

Simulations

Explore the built-in simulation environments.

Training with RL

Train agents using RLlib or WarpDrive.

Extending Foundation

Build custom components and scenarios.
The Google Colab tutorials let you run interactive examples in your browser without any local setup.