A C++ and Python-based application simulating the impact of healthcare policies on patient outcomes. This project leverages modern C++ (C++20/23) features and Python for predictive modeling and data visualization, providing stakeholders with actionable insights.
The microsimulation model evaluates the impact of healthcare policies, considering patient attributes such as age, gender, and risk factors. It uses:
- Modern C++ features like multithreading, vectorization, and smart pointers for fast, scalable simulations.
- Predictive modeling and dashboards to support data-driven policy-making decisions.
The model is designed for Windows 11 running on:
- CPU: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz.
- GPU: NVIDIA GeForce MX330.
- Scalable Simulations: Supports parallel processing and vectorization for large-scale simulations.
- Predictive Modeling: Models health risks based on patient attributes using Python ML tools.
- Interactive Visualizations: Dashboards for exploring health metrics, risk factors, and policy outcomes.
- Detailed Reporting: Generates patient-level data, population summaries, and policy impact metrics.
- Modular Design: Extensible C++ and Python architecture for easy enhancements.
Total population size: 100,000
Risk factor distribution:
diabetes 22786
hypertension 22907
obesity 23120
smoking 23085
Population Metrics Report:
Average Health Score: 81.70%
Proportion At Risk: 66.67%
Proportion with Diabetes: 24.88%
Proportion with Hypertension: 25.03%
Proportion with Obesity: 23.12%
Proportion with Smoking: 23.08%
Classification Report:
precision recall f1-score support
diabetes 0.25 0.22 0.23 4579
hypertension 0.26 0.22 0.24 4571
obesity 0.26 0.22 0.24 4725
smoking 0.25 0.22 0.23 4500
Dash is running on
http://127.0.0.1:8050/
microsimulation-model/
βββ CMakeLists.txt
βββ README.md
βββ LICENSE
βββ docs/
β βββ architecture.png # Architecture diagram
β βββ class_diagram.png # Class diagram
β βββ sequence_diagram.png # Sequence diagram
β βββ use_case_diagram.png # Use Case diagram
β βββ output_diagram.png # Output structure diagram
β βββ usage_guide.md # Detailed usage guide
βββ include/
β βββ *.h # Header files for core classes
βββ src/
β βββ *.cpp # Implementation of core classes
βββ python for visualization/
β βββ *.py # Python scripts for analysis and dashboards
βββ tests/
β βββ *.cpp # Unit tests
β βββ CMakeLists.txt
βββ data/
β βββ patients_data.csv # Synthetic patient data
βββ scripts/
β βββ run_simulation.sh # Script to run simulations
β βββ generate_report.sh # Script to generate reports
βββ images/
βββ *.png # Diagrams and visualizations
π¦ Prerequisites
C++ Tools:
CMake (version 3.16+)
GCC, Clang, or MSVC compiler
Python Tools:
Python 3.8+
Libraries: numpy, pandas, matplotlib, seaborn, scikit-learn, dash
- Clone the repository and build the project using CMake:
git clone https://github.com/M-Ghosh9/Microsimulation-model.git
cd Microsimulation-model
- Build the C++ application
mkdir build
cd build
cmake ..
make
- Install python dependencies
pip install -r requirements.txt
To run the simulation:
./microsimulation.exe
To run unit tests:
./tests/tests
Use the provided script to generate reports:
./scripts/generate_report.sh
cd python\ for\ visualization/
python dashboard.py
Open the dashboard in your browser at
http://127.0.0.1:8050.
- Health Score Distribution across the population

- Prevalence of Diabetes across Age Group and Gender

- Prevalence of Hypertension across Age Group and Gender

- Prevalence of Obesity across Age Group and Gender

- Prevalence of Smoking across Age Group and Gender

Focus on high-risk groups (health scores <60). Promote interventions targeting prevalent risk factors.





