This project is a web-based epidemic simulation tool built with Flask, where users can configure parameters like population size, infection chance, and hospital capacity to observe the spread of disease over time. It models the behavior of individual agents (people) moving through different locations (homes, workplaces, hospitals) and updates their health status based on probabilistic rules. The system also supports saving and loading simulation scenarios for analysis and comparison.
The page provides an interface for setting up and running a world simulation, including options to adjust parameters related to the population, disease, and simulation speed. It also displays a visual map of the simulation and dynamic charts to track its progress over time.
The World Settings section allows users to configure the basic environment for the simulation. It includes sliders to adjust the initial population size, number of available hospital beds, and the income generated per hour by working agents. These settings define the starting conditions of the simulated world, influencing how the population behaves and how resources like healthcare and money are distributed during the simulation.
The Disease Settings section allows users to define how the disease behaves during the simulation. Users can adjust the chances of infection, recovery (both outside and inside hospitals), and death. It also lets them set how many individuals are initially sick at the start of the simulation.
The Collect Simulation Data section allows users to control how fast the simulation runs and how often the data is saved. It includes options to adjust the simulation speed and set the number of days after which the simulation results are recorded. Users can also specify a file name to save the simulation data for future analysis or optimization.
The Optimize the Solution section provides settings for running optimization processes on the simulation results. Users can define a custom cost function to guide the optimization, such as maximizing healthy individuals or minimizing deaths. They can also adjust the final temperature parameter, which is typically used in optimization techniques like simulated annealing.
The Replay Simulation section allows users to load previously saved simulation scenarios. Users can specify the file name of the saved data and control the playback speed to review how the simulation evolved over time. This feature is useful for analyzing different outcomes and comparing the effects of various settings.
The map displays the simulated world where individual agents are shown moving between different locations, such as homes, workplaces, and hospitals. Each agent’s position is updated in real time based on their schedule, status, and interactions with the environment. This visual representation helps users easily observe the spread of infection, agent behavior, and the overall state of the population during the simulation.
The charts display key statistics of the simulation over time. One chart shows the number of healthy, sick, and dead individuals, helping users track how the disease spreads and affects the population. Another chart visualizes the total earnings generated by the working agents, reflecting the economic impact of the simulation's progression.
- In the future, a feature should be added to visualize the life of a single agent from a past simulation, allowing detailed tracking of where they moved, when they became sick, and when they died.