Skip to main content
The Gather-Trade-Build simulation is the core scenario in the AI Economist Foundation framework. Mobile agents navigate a 2D grid world, gather scarce resources (wood and stone), trade them with each other through a commodity exchange, and use the resources to build houses and earn income. A social planner agent sets tax policy to influence the distribution of wealth.

Scenario variants

Two scenario names are registered: Both variants share the same agent types (BasicMobileAgent, BasicPlanner) and required entities (Wood, Stone).

Components used

Registered as Gather. Allows mobile agents to move around the world and collect resources. Supports heterogeneous collection skill via skill_dist (none, pareto, or lognormal). Key parameters:
  • move_labor (float, default 1.0): Labor cost per move.
  • collect_labor (float, default 1.0): Additional labor cost when collecting a resource.
  • skill_dist (str, default "none"): Skill distribution for bonus collection probability.
Registered as Build. Allows agents to spend 1 wood + 1 stone to place a house landmark, earning coin. Supports heterogeneous build skill. Key parameters:
  • payment (int, default 10): Base coin earned per house built.
  • payment_max_skill_multiplier (int, default 1): Upper bound on the skill multiplier.
  • skill_dist (str, default "none"): Skill distribution for build income.
  • build_labor (float, default 10.0): Labor cost per build action.
Registered as ContinuousDoubleAuction. Implements a commodity-exchange-style market where agents submit bids and asks for resources. Trades clear when a bid meets or exceeds an ask. Key parameters:
  • max_bid_ask (int, default 10): Maximum coin value for a bid or ask.
  • order_labor (float, default 0.25): Labor cost for placing an order.
  • order_duration (int, default 50): Timesteps before an unfilled order expires.
  • max_num_orders (int, optional): Maximum open orders per resource per agent.
Two redistribution components are available:
  • WealthRedistribution: Passively divides total agent coin equally each step. No planner actions required.
  • PeriodicBracketTax: The planner sets marginal tax bracket rates. Taxes are collected and redistributed as lump-sum payments at the end of each tax period.
WealthRedistribution must always be placed last in the component list.

Key scenario parameters

The Uniform scenario (uniform/simple_wood_and_stone) exposes the following constructor arguments in addition to the base environment arguments.

Instantiating the environment

To use the fixed-layout variant instead, change the scenario name and add the layout file parameter:

Observation space

Each mobile agent’s observation consists of:
  • A spatial tensor (egocentric or full-world view, depending on full_observability) with channels for each resource type, agent locations, house locations, and water.
  • Inventory contents: current holdings of Wood, Stone, Coin, and Labor.
  • Endogenous quantities: accumulated labor.
The planner agent receives:
  • A spatial tensor of the world (if planner_gets_spatial_info=True).
  • The inventory of each mobile agent.
  • Current tax rates (when using PeriodicBracketTax).

Reward structure

Mobile agents receive isoelastic utility over coin minus a labor cost:
where u(coin) is the isoelastic function parameterized by isoelastic_eta. The social planner receives one of three reward types (set via planner_reward_type):

Tutorials

Economic simulation (basic)

Interact with and visualize the simulation interactively in Colab.

Economic simulation (advanced)

Explore composable building blocks and custom scenario construction.

Optimal taxation

Use the simulation to study optimal tax policy design.

Multi-agent training with RLlib

Train agents with distributed RL using RLlib.