presentation by Flavio58

VIEWS: 5 PAGES: 10

									Agent Based Model of the Spread of a Virus
Matt Wade

Purpose


To determine if staying home because you are sick and might spread the disease is a valid excuse

Inputs
  

Number of sick and healthy agents
Number of different classes Number of steps

To be added:
  

Infectiousness of the sickness
Type of sickness

Length of sickness

Outputs
   

Number of infections and recoveries
Number of sick and healthy agents Number of steps Location of each agent and status (will be picture soon)‫‏‬

Major Changes


Switched from having two agent classes and separate arraylists to one agent class
Updated GUI





Allows addition of multiple agents or steps at once
People aren't permanently sick!



Old GUI

UGLY

New GUI

Old checkinfection()‫‏‬
Separate healthy and sick arraylists Inefficient


for(int x=0;x<tempnuminfected;x++) { sickagents.add(new SickAgent(numclasses,healthyagents.get(posinfected[x]).getSchedule(),per iod)); healthyagents.remove(posinfected[x]); numhealthy--; numsick++; for(int y=x;y<tempnuminfected;y++)‫‏‬ if(posinfected[y]>posinfected[x])‫‏‬ posinfected[y]--; }

New checkinfection()‫‏‬
More efficient Less complicated


for(int y=0;y<numagents;y++)‫‏‬ if(agents.get(x).getPos()==agents.get(y).getPos() && agents.get(x).getType()==0)‫‏‬ if((Math.random()*100)<(double)agents.get(y).getInfectionPercent())‫‏‬ { posinfected.add(x); agents.get(x).setType(1); numsick++; numhealthy--; numinfections++; tempnuminfected++; } for(int x=0;x<tempnuminfected;x++)‫‏‬ agents.get(posinfected.get(x)).infect();

Results


Agents are not permanently sick (chance of infection was 500% instead of 5%)‫‏‬
Agents become sick at a reasonable rate





Results are believable this time although not based on real medical data yet


								
To top