Skip to content

Demonstrating how a virus (or other disease) can spread using a simple simulation (made in java)

Notifications You must be signed in to change notification settings

BricksAndPieces/Virus-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Virus-Simulation

Video demonstration of simulation:

Virus Simulation Video

How does it work?

A virus is spread by direct contact. The variables in the Constants class can be changed to change different aspects of the simulation.

public class Constants {

    public static final int GRAPH_SIZE = 100; // Width of graph
    public static final int GRAPH_UPDATE_PER_FRAMES = 15; // Frames per graph update

    public static final int CITY_SIZE = 100; // Number of people
    public static final double MAX_SPEED = 0.5; // speed of people
    public static final double PEOPLE_SIZE = 2; // diameter of people
    public static final int INFECTION_TIME = 250; // how long people should have the virus

    public static final double HEAL_CHANCE = 0.50; // chance to heal
    public static final double INFECT_CHANCE = 0.75; // chance to infect

    public static final double HEALTH_INDUSTRY = 0.6; // what percent of the population the health industry can care for
}

How to start?

Press any key to infect someone

About

Demonstrating how a virus (or other disease) can spread using a simple simulation (made in java)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages