TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/salesforce/ai-economist/llms.txt
Use this file to discover all available pages before exploring further.
Build component (registry name "Build") allows BasicMobileAgent instances to spend one unit each of Wood and Stone to construct a House landmark on their current tile, receiving a coin payment in return. Building has a configurable labor cost and supports heterogeneous skill levels that modify each agent’s payout.
The agent must be standing on an empty tile — no existing landmark or resource — and must possess the required resources in their inventory before the build action takes effect.
Constructor parameters
Base amount of
Coin an agent receives for successfully building a house. Must be >= 0.Upper bound on the skill multiplier applied to
payment. Must be >= 1. When set above 1, skilled agents can earn up to payment * payment_max_skill_multiplier per build.Distribution used to sample each agent’s build skill at episode reset.
| Value | Behavior |
|---|---|
"none" | All agents use a multiplier of 1 (uniform skill) |
"pareto" | Multipliers sampled from a Pareto distribution |
"lognormal" | Multipliers sampled from a log-normal distribution |
Labor units charged to
agent.state["endogenous"]["Labor"] each time a house is successfully built. Must be >= 0.Resource cost
Building a house always consumes exactly:| Resource | Amount |
|---|---|
Wood | 1 unit |
Stone | 1 unit |
self.resource_cost = {"Wood": 1, "Stone": 1}.
Required world entities: Wood, Stone, Coin, House, Labor.
Action space
This component adds 1 discrete action for eachBasicMobileAgent:
| Action index | Meaning |
|---|---|
0 | No-op — do nothing |
1 | Attempt to build a house at the current tile |
Building sequence
When an agent takes action1, component_step() calls agent_can_build() to verify all preconditions, then:
- Deducts 1
Woodand 1Stonefrom the agent’s inventory. - Calls
world.create_landmark("House", row, col, agent.idx)to place the landmark. - Adds
agent.state["build_payment"](the skill-adjusted coin amount) to the agent’s inventory. - Charges
build_labortoagent.state["endogenous"]["Labor"].
Build preconditions
agent_can_build() returns True only when all three conditions hold:
- The agent has
>= 1Woodin inventory. - The agent has
>= 1Stonein inventory. - The current tile contains no existing resource or landmark.
Agent state fields
This component adds the following state fields to everyBasicMobileAgent:
Effective coin payout for the next build action. Initialized to
payment and updated each episode reset according to the sampled skill multiplier.Raw sampled skill value (before clamping). Initialized to
1.Observations
Agents observe their own normalized build skill. The planner receives nothing from this component.Agent’s current
build_payment normalized by the base payment value.The raw sampled skill value stored in
sampled_skills[agent.idx].Action masks
The single build action is masked to0 whenever agent_can_build() returns False (insufficient resources or tile already occupied). It is unmasked (1) otherwise.
Metrics
get_metrics() returns a dict with per-agent build counts and a total:
Number of successful builds by this agent over the episode.
Total number of
House landmarks currently on the map (world.maps.get("House") > 0).Dense log
get_dense_log() returns a list (one entry per timestep) of build-event lists. Each build event is a dict:
Agent index that performed the build.
[row, col] location where the house was placed.Coin payment received for this build.
Skill sampling
At every episode resetadditional_reset_steps() re-samples each agent’s skill:
skill sampling