Projects Inventory

Simulation of Epidemic Spread Gaming Project in C++

Explanation

  1. Class EpidemicModel:
    • Purpose: Simulates the spread of an epidemic over time.
    • Advertisement
    • Attributes:
      • susceptible: Number of susceptible individuals.
      • infected: Number of infected individuals.
      • recovered: Number of recovered individuals.
      • infectionRate: Rate at which susceptible individuals get infected by contact with infected individuals.
      • Advertisement
      • recoveryRate: Rate at which infected individuals recover.
      • timeStep: Time interval for each simulation step.
    • Methods:
      • simulate(double totalTime): Runs the simulation from time 0 to totalTime.
        • Calculations: Updates the number of susceptible, infected, and recovered individuals based on the infection and recovery rates.
        • Outputs: Prints the state of the epidemic at each time step.
  2. Main Function:
    • Setup: Prompts the user for initial conditions, rates, time step, and total simulation time.
    • Simulation: Creates an instance of EpidemicModel and runs the simulation.

Usage

Exit mobile version