Economic Model

The main economic model class that orchestrates the agent-based simulation with comprehensive inline documentation explaining the simulation flow and component interactions.

class climapan_lab.src.models.EconModel(parameters: Dict[str, Any])[source]

Bases: Model

setup()[source]

Initialize the agents and network of the model.

step()[source]

Define the models’ events per simulation step.

initiate_step()[source]

This internal function of the model is used to reset temporary variables or to accumulate variable every step

stepwise_forecast()[source]

This internal function of the model is used to make forecast for some of the agents for the upcoming time step, if neccessary

stepwise_produce()[source]

This internal function of the model is used to propagate the production of the firm agents

stepwise_after_production(eps=1e-08)[source]

This internal function of the model is used to do jobs after production

stepwise_termination()[source]

This internal function of the model is used to clean up and summarize stepwise variables

update(eps=1e-08)[source]

Record metrics for analysis

end()[source]

Record evaluation measures at the end of the simulation.

Model Architecture

The EconModel follows a well-documented daily timestep approach with monthly economic cycles:

  • Daily Steps: Each model step represents one day with COVID progression

  • Monthly Cycles: Economic activities (production, hiring, sales) occur monthly

  • Climate Integration: Step-by-step climate dynamics with emissions, temperature, and shocks

  • Pandemic Dynamics: SEIR-like disease progression with age-group specific transitions

Model Components

The EconModel integrates several key components with detailed documentation:

  • Agents: Consumers, firms, banks, government with comprehensive lifecycle documentation

  • Climate Module: Environmental effects and climate policies with detailed step-by-step dynamics

  • COVID Module: Pandemic dynamics and interventions with SEIR progression

  • Economic Mechanisms: Markets, pricing, employment with clear implementation details

Key Methods

EconModel.__init__(parameters: Dict[str, Any])

Initialize a new model.

Parameters:

parameters – Dictionary of model parameters

EconModel.setup()[source]

Initialize the agents and network of the model.

EconModel.step()[source]

Define the models’ events per simulation step.

EconModel.run(steps: int | None = None) Dict[str, DataFrame]