Agent Econ is an agent-based macroeconomy simulation running in the browser. Micro-level household and firm behavior is simulated in deterministic tick phases, while the UI renders macro trends and agent-level flows in real time.
- Active runtime: TypeScript + Web Worker (
packages/sim-core,apps/web) - Hosting target: GitHub Pages (static)
- Python source is archived in
legacy-python/for reference
Implementation details are documented in IMPLIMENTATION_REPORT.md.
Prerequisites:
- Node.js 22+
Install:
npm installRun locally:
npm run devTypecheck:
npm run typecheckProduction build:
npm run buildapps/
web/ # Vite web app (controls, charts, canvas rendering)
packages/
sim-core/ # Simulation kernel, contracts, phase logic
.github/workflows/
deploy-pages.yml # GitHub Pages deploy workflow
data/
scenarios/ # Scenario inputs (includes baseline.python.v1.json)
baselines/ # Reserved for calibration artifacts
legacy-python/ # Archived Python source/config from pre-web migration
The simulation runs as a worker-driven tick loop in the browser.
Tick phase order:
- Production
- Market
- Payday
- Profit Distribution
- Labor
- Strategy
- Banking
The engine streams per-tick outputs to the UI:
- Summary metrics (sales, wages, unemployment, dividends, production)
- Event counts
- Transaction events (used for particle animations)
Current visualization features:
- Full dark-mode UI
- Macro charts for sales, unemployment, wages, dividends
- Agent-space rendering (firms, households, banks)
- Ownership links (firm -> owner household)
- Spending and wage particle flows
- Metadata panel hidden by default and toggled from controls
- Device-pixel-ratio aware canvas rendering for crisp graphics
Primary runtime config currently lives in:
apps/web/src/runtime/defaultConfig.ts
Baseline scenario artifact copied from the Python project:
data/scenarios/baseline.python.v1.json
Deployment workflow:
.github/workflows/deploy-pages.yml
Vite repo-pages base path is configured in:
apps/web/vite.config.ts
Pushes to main trigger build and Pages deploy.
- This repository is mid-migration; core web runtime is working, with additional hardening and calibration work remaining.
- Archived Python code in
legacy-python/is retained as historical reference, not active runtime.