Agent-Based Economic Simulation

Agent-Based Economic Simulation

A dynamic agent-based simulation modeling economic interactions between autonomous agents and limited resources. The system explores resource allocation strategies, price dynamics, and wealth distribution under various economic parameters.

Key Features

Getting Started

Requirements

Basic Usage

Run full experimentation suite:

python main.py

Code Structure

File Purpose
constants.py Central configuration of simulation parameters
models.py Agent/Resource class definitions with core behaviors
simulation.py Main simulation loop and step-by-step execution logic
helpers.py Economic calculations and system operations
experimentation.py Parameter space exploration and result analysis
main.py Entry point for running experiments and viewing results

Core Parameters (constants.py)

Parameter Description Default
NUM_AGENTS Initial population size 50
SIMULATION_STEPS Duration of each simulation run 100
TAX_RATE Wealth redistribution percentage 2%
PRICE_ELASTICITY Demand sensitivity to price changes 0.05
RESOURCE_REGEN_RATE Base resource regeneration rate 1%
BANKRUPTCY_THRESHOLD Balance level for agent removal -50
AGENT_INCOME_CEILING Maximum possible agent income 1.0

Experimentation Insights

The system tests four key parameters across ranges:

  1. Price Elasticity (0.01-0.1)
  2. Resource Regeneration (0.005-0.02)
  3. Tax Rates (0-5%)
  4. Expense Rates (10-50%)

Sample findings:

Tax rate that minimizes bankruptcies: 0.0278
Regen rate that maximizes average final balance: 0.0189

Key Metrics Tracked

Simulation Flow

  1. Price updates based on resource utilization
  2. Resource allocation through agent bidding
  3. Income distribution and expense deduction
  4. Tax collection/redistribution
  5. Bankruptcy checks and agent removal
  6. Resource regeneration and capacity adjustment
  7. Agent behavior adaptation

Analysis Capabilities

Source Code

Browse the source repository