What the simulation models
The RBC simulation extends classical real business cycle theory to a multi-agent setting with strategic interactions:- Consumers choose how much to work and how much of each firm’s good to consume, subject to a budget constraint. Each consumer has a private
thetaparameter (disutility of work). - Firms set prices, wages, and capital investment. Production follows a Cobb-Douglas function parameterized by a firm-specific
alpha. - Government sets income and corporate tax rates to influence economic outcomes.
Global state layout
The global state has dimension4 * num_firms + 2 * num_governments + 1:
Per-agent private state extensions:
Directory structure
Dependencies
Running experiments
1
Single experiment
Train one configuration defined in
constants.py:2
Hyperparameter sweep
Launch a Cartesian-product sweep over the parameter grids defined in Parameter sweeps are defined as
train_multi_exps.py:*_param_sweeps dictionaries in the file. Each hyperparameter takes a list of one or more values; all combinations are run.3
Approximate best-response training
Train one agent type against fixed checkpointed policies from a previous run:
--ep-strs specifies which saved episode checkpoints to load (e.g. policies saved at episodes 0, 10000, and 200000). --agent-type can target a single agent type or all.Configuration dictionaries
Experiment configuration is managed through Python dictionaries with three top-level keys:hparams.yaml in the job output directory at the start of training.
Action discretizations
Actions are discrete indices mapped to real-valued choices at runtime:
Action arrays are saved to
action_arrays.pickle in each run directory so that index-to-value mappings are preserved alongside saved policies.
Output files
Each training run produces arollout-XXXXXX-XXXXX/ directory:
.npz rollout file has keys states, actions, rewards, action_array, and aux_array. Array shapes:
Saving frequency
The default configuration saves dense rollouts frequently. To reduce disk usage, settrain.save_dense_every in the configuration dictionary to a larger integer before starting the run.
Reference
For details on the model and results, see:Finding General Equilibria in Many-Agent Economic Simulations using Deep Reinforcement Learning
(ArXiv link forthcoming as of this writing)