A high-performance C++ backend designed to simulate millions of Monopoly games to derive optimal strategic metrics, ROI curves, and landing probabilities.
Monte Carlo Monopoly is more than just a game simulation; it's a strategic analysis tool. By utilizing Monte Carlo methods, the engine executes thousands of iterations to model the complex economics of Monopoly. It provides the data necessary to drive a real-time analytics dashboard, helping players understand which properties offer the best yield under varying risk tolerances.
- Monte Carlo Simulation Engine: Run thousands of games in seconds to capture statistical significance.
- Lead Strategist (AGENT_01): A sophisticated AI agent with a parameterized risk tolerance (
alpha). - Dynamic ROI Analytics: Calculates Realized Return on Investment for every property group.
- Board Heatmapping: Statistical landing probabilities across all 40 squares.
- JSON API Output: Structured payload designed for direct integration with React-based frontend dashboards.
- Rule Customization: Toggle specialized rules like Free Parking Windfalls, Rapid Auctions, and Mortgage Leverage.
The engine utilizes a specialized Decision Tree logic for agents. The alpha parameter (0.0 to 1.0) dictates an agent's risk appetite:
- Low Alpha (Conservative): Maintains higher cash reserves, avoids aggressive property builds.
- High Alpha (Aggressive): Reinvests liquidity immediately into houses/hotels to maximize rent yields.
The executable supports a variety of flags to customize the simulation environment:
| Flag | Description | Default |
|---|---|---|
--sims <int> |
Number of game iterations to run | 1 |
--agents <int> |
Number of AI agents (2-8) | 4 |
--liquidity <int> |
Starting cash for all agents | 1500 |
--alpha <float> |
Risk tolerance for AGENT_01 (0.0 to 1.0) | 0.5 |
--json |
Enable structured JSON output mode | false |
--free-parking-windfall |
Enables cash collection on Free Parking | false |
--stochastic-rent |
Adds variance to rent payments | false |
- CMake (3.15+)
- C++17 Compiler (GCC, Clang, or MSVC)
- Clone the repository:
git clone https://github.com/godking123/Monte-Carlo-Monopoly.git
- Build the project:
mkdir build && cd build cmake .. cmake --build . --config Release
- Run the Simulation:
./MonteCarlo-Monopoly --sims 1000 --json --alpha 0.8
When running with the --json flag, the engine emits a payload containing:
boardHeatmap: Frequency of landings for all 40 positions.propertyEfficiency: Real-time ROI and landing probability per property.strategyEngine: Winning probabilities, ROI curves (Aggressive vs. Conservative), and optimal property weightings.propertyMatrix: High-fidelity data for the dashboard (Live logs, agent net worth, and property ownership).
Developed for advanced game theory analysis and statistical modeling.
