A computational framework for simulating and controlling multi-agent systems using Behavioral Mean Field Games (MFG) in Google Colab. This project explores how classical Nash Mean Field Equilibria (MFE) deform under the influence of bounded rationality, cognitive biases, and informational constraints.
The simulation is powered by a coupled system of partial differential equations (PDEs) solved via an iterative Picard scheme with Anderson relaxation:
-
Hamilton-Jacobi-Bellman (HJB) Equation (Solved backward in time) β Determines the optimal value function
$V(t, x)$ and behavioral strategies$u^*(t, x)$ for an individual agent. -
Fokker-Planck-Kolmogorov (FPK) Equation (Solved forward in time) β Governs the advection and diffusion of the total population density
$m(t, x)$ driven by agent controls and environmental noise.
| Model Scenario | Mathematical Paradigm | Visual Effect on Population Density | Socio-Economic Intuition |
|---|---|---|---|
| 1. Rational Baseline (MFE) | Smooth bell curve shifting effectively toward the objective center ( |
Agents possess infinite computing power and zero reaction time. | |
| 2. Bounded Rationality | Sharp, anomalous local cluster with an elevated narrow peak |
Cognitive noise |
|
| 3. Prospect Theory | Heavily flattened, highly dispersed distribution across the entire space. Peak |
Hypertrophied crowd aversion ( |
|
| 4. Informational Lag | Phase-lagged, multi-modal distribution stuck at the initial position ( |
Rational inattention. Agents react to "ghosts of the crowd" from past states, resulting in severe overshooting. |
To correct irrational crowding behaviors, a feedback penalty field
- Geometric Correction: The controller perfectly forces the disoriented population to align with the socially optimal path.
-
Economic Inefficiency: Forcing irrational agents onto a rational trajectory induces an exponential spike in their control energy expenditure (
$0.5 \nu u^2$ ). This validates the concept of coordination cost overheads in complex human-centric systems.
- Open Google Colab and run the initialization cell to establish the space-time grid (
$N_t=200, N_x=60$ ). - Execute the
BehavioralMFGSolverclass and its derived behavioral extensions. - Run the evaluation dashboards to render comparative population dynamics plots.