Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in java ty. you will be creating software to model a disease outbreak given user defined parameters to determine how vaccinating portions of

This is in java ty.

you will be creating software to model a disease outbreak given user defined parameters to determine how vaccinating portions of the population affects the outbreak characteristics. Your software should determine, for each simulation, the peak number of infectious individuals and the day on which that occurred, as well as when the outbreak ended and how long the outbreak lasted. Your software should allow the user to specify which file contains the disease model information, read that information in, and then automatically execute the simulations and output data. In disease modelling, one of the basic models is called the SIR model. SIR stands for Susceptible, Infectious, and Recovered, which represent the different states a person can be in with regard to an illness. A susceptible person is someone who is not sick, but can become sick. An infectious person is someone who is sick and can infect others with the disease. A recovered person is someone who is no longer sick and has developed an immunity to the disease. To represent the process of being healthy, becoming sick, and recovering, we can use simple differential equations to compute the diseases progress over time. In this case we will be assuming each time step represents one day. To calculate the number of susceptible, infectious, and recovered individuals each day we can use the following equations: = = + = + In these equations, Si is the number of susceptible people on day i, Ii is the number of infectious people on day i, Ri is the number of recovered people on day i, is the contact rate (the rate at which people come into contact with infectious individuals and become infected), and is the recovery rate (the rate at which people recover from the disease). Additionally, since we are using differential equations, to calculate the values of Si, Ii, and Ri, you need the values of the previous days Si, Ii, and Ri, values Si-1, Ii-1, Ri-1. A typical graph of the progression of an outbreak might look like the following, where the number of susceptible individuals decreases over time, the number of infectious individuals grows, peaks, and then decreases, and the number of recovered individuals grows over time.

The model configuration file will always have the following lines in the following order, though their associated values may vary o Population: which represents the total number of individuals in the model o InitialInfected: which represents the initial number of infected individuals in the model o ContactRate: which represents the contact rate to the used in the model o RecoveryPeriod: which represents the number of days a individual stays infectious before recovering o PercentageVaccinated: which represents what percentage of the population will be vaccinated o See example input files Your program should prompt the user for the name of the file the model configuration information, using a JInputDialog, with an appropriate message Your program should make sure the file exists, and if it does not exist, repeatedly prompt the user for a correct filename until one is provided Your program should read in and store the population count, initial infected count, contact rate, recovery period, and percentage of vaccinated individuals in appropriate variables o The recovery period should be used to calculate the recovery rate, such that the recovery rate is (1/recovery period) o Be sure to close your input stream when finished reading After the file is read in, the initial number of infected, contact rate, recovery period, and vaccination percentage should be output to the user, using a JMessageDialog, with an appropriate message Your program should perform 5 simulations o The first simulation should have no vaccinated individuals, the second simulation should have the vaccinated percentage number of vaccinated individuals, the third simulation should have two times the vaccinated percentage number of vaccinated individuals, etc

The number of simulations should be stored in a constant variable and that variable should be used instead of the number 5 o The full output of each simulation should be written to a separate file named Disease_out_val.txt where val is the id number of the simulation, and ids range from 1-5 Thus, you should have five separate output files after your program has completed executing, one for each simulation For each simulation your program should: o Set the initial number of susceptible (S), infectious (I), and recovered (R) individuals The initial number of susceptible individuals can be calculated by subtracting the initial number of infection and vaccinate individuals from the total number of individuals The initial number of infectious individuals is stored in the model information file The number of recovered individuals is assumed to be 0 at the beginning of the simulation The initial number of individuals in each category represents the initial configuration of the outbreak on day 0, and should be output o Because you are using differential equations in this simulation, will need to set Si-1, Ii-1, Ri-1 to the initial values of the number of susceptible individuals, infectious individuals, and recovered individuals, respectively. o In order to determine the length of the outbreak, you will need to count the number of days until the number of infectious individuals is below 0.5. For each day you should perform the following steps: Update the current number of susceptible, infectious, and recovered (S, I, R) individuals using the appropriate equation and variables Determine if the current day has the highest number of infectious individuals, and store the day and count if it does Output the day, count of susceptible, infectious, and recovered individuals, with two decimal points of precision, to the appropriate file in a regularly spaced, tabular format The goal is to make this easy to read, so you might consider using printf() or String.format() in order to make sure all of your outputs line up correctly See example output files Update the values of the previous days susceptible, infectious, and recovered individuals counts (Si-1, Ii-1, Ri-1) to the current days susceptible, infectious, and recovered individuals counts (S,I,R) Increment the day counter o Once the number of infectious individuals is below 0.5, you should output the id of the simulation, the number of days it took the outbreak to complete, the percentage of the population that was vaccinated, the peak day of infection and the number of infectious individuals on that day, with 2 decimal points of precision This should be output to both the file and to the user using a JMessageDialog See example output files No class scoped variables are allowed for this project

Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, date, and brief description), comments for each variable, and commented blocks of code Your program source code should be named SIR.java

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

Why do many organizations have a kick-off meeting? AppendixLO1

Answered: 1 week ago

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago

Question

=+ Who do you think is right? Why?

Answered: 1 week ago