This is the template project for the HPC-05 Programming Lab project "Disease Simulation". here will be the explanation of my project (shahram)
Please note that context and additional information on how this repository is to be used is provided in the lectures!
The following two steps shall be done by each student individually:
- Fork this repository
- Add the lecturer (christoph.schober@th-deg.de) with REPORTER role to your fork
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own.
This project simulates the spread of a disease between two populations (Deggendorf and Regensburg) using a simple epidemiological model. The simulation considers factors such as the size of each population, vaccination rates, and the transmissibility of the disease. The goal is to observe how the disease spreads within and between these two populations over time.
The project is implemented in C++ and utilizes an external configuration file (disease_in.ini
) to specify simulation parameters such as population sizes, vaccination rates, disease duration, and transmissibility. The results of the simulation are output to a CSV file (simulation_data.csv
) for further analysis.
├── include/
│ ├── INIReader.h # Header file for INIReader library
├── src/
│ ├── main.cpp # Main simulation code
│ ├── simulation.h # Header file defining simulation classes and functions
├── disease_in.ini # Configuration file specifying simulation parameters
├── simulation_data.csv # Output file generated by the simulation
├── README.md # Project documentation
└── LICENSE # License file (if applicable)
To run this simulation, you'll need:
- A C++ compiler (e.g., GCC, Clang)
- INIReader library for parsing the INI configuration file
-
Clone the repository:
git clone https://github.com/yourusername/disease-simulation.git cd disease-simulation
-
Compile the code:
g++ -o simulation src/main.cpp -I include/
After compiling the code, you can run the simulation:
./simulation
The program will load the configuration from disease_in.ini
, run the simulation, and output the results to simulation_data.csv
.
The disease_in.ini
file contains the parameters for the simulation. Below is an example configuration:
[global]
simulation_name = "Disease Simulation"
num_populations = 2
simulation_runs = 100
[disease]
name = "Flu"
duration = 10
transmissability = 0.2
[population_1]
name = "Deggendorf"
size = 1000
vaccination_rate = 0.6
[population_2]
name = "Regensburg"
size = 800
vaccination_rate = 0.4
- simulation_name: Name of the simulation.
- num_populations: Number of populations to simulate.
- simulation_runs: Number of simulation runs.
- disease: Contains parameters specific to the disease, such as its name, duration, and transmissibility.
- population_1, population_2: Specifies the name, size, and vaccination rate of each population.
The simulation results are stored in simulation_data.csv
. The columns in this file include:
- Day: The simulation day number.
- Totall_deg: Total population size of Deggendorf.
- Vaccinated_deg: Number of vaccinated individuals in Deggendorf.
- Infected_deg: Number of infected individuals in Deggendorf.
- Susceptible_deg: Number of susceptible individuals in Deggendorf.
- Recovered_deg: Number of recovered individuals in Deggendorf.
- Totall_reg: Total population size of Regensburg.
- Vaccinated_reg: Number of vaccinated individuals in Regensburg.
- Infected_reg: Number of infected individuals in Regensburg.
- Susceptible_reg: Number of susceptible individuals in Regensburg.
- Recovered_reg: Number of recovered individuals in Regensburg.
Below is a sample of what the simulation_data.csv
might look like:
Day,Totall_deg,Vaccinated_deg,Infected_deg,Susceptible_deg,Recovered_deg,Totall_reg,Vaccinated_reg,Infected_reg,Susceptible_reg,Recovered_reg
1,1000,600,1,399,0,800,320,0,480,0
2,1000,600,5,395,0,800,320,2,478,0
3,1000,600,10,390,0,800,320,4,476,0
...