Skip to content

Core

Engine

policy_arena.core.engine

Engine — thin orchestration layer on top of Mesa's run loop.

RunResults(model_metrics, agent_metrics, extra=dict()) dataclass

Container for simulation output.

Engine

Instantiates a scenario, runs it, extracts results.

Scenario

policy_arena.core.scenario

Scenario configuration — plain dataclass for Phase 1.

Scenario(world_class, world_params=dict(), steps=100, seed=None) dataclass

Full specification for a simulation run.

In Phase 1 this is constructed programmatically. YAML config loading added in Phase 2.

Types

policy_arena.core.types

Shared types used across the simulation engine.

Plain dataclasses — no Pydantic until Phase 2 config layer.

Action

Bases: Enum

Discrete action space for matrix games.

Observation(my_history=list(), opponent_history=list(), round_number=0, extra=dict()) dataclass

What an agent sees before making a decision.

For PD: history of past rounds with each opponent. Extensible via extra for game-specific observations.

RoundResult(action, opponent_action, payoff, round_number) dataclass

Outcome of a single round for one agent.