Title: Agent Based Model of the Spread of a Virus
1- Agent Based Model of the Spread of a Virus
- Matt Wade
2Purpose
- To determine if staying home because you are sick
and might spread the disease is a valid excuse
3Inputs
- Number of sick and healthy agents
- Type of sickness
- Infectiousness of the sickness
- Number of different classes
- Length of sickness
4Outputs
- Number of infections and recoveries
- Number of sick and healthy agents
- Picture showing location of each agent and status
5Current State
- Current GUI
- Will eventually have picture below with locations
of agents - Will also have more options and ability to add
multiple agents at once
6First Version of checkinfection()?
Inside of for loops
if(healthyagents.get(x).getPos()sickagents.get(y
).getPos())? if(Math.random()lt(sickagents.get(y
).getInfectionPercent()))? if(inArray(posinfe
cted,tempnuminfected,x)false)? posinfecte
dtempnuminfectedx tempnuminfected num
infections //switched agent from healthy to
sick here
7Fixed checkinfection()?
Inside of the first for loop for checkinfection()?
for(int x0xlttempnuminfectedx)
System.out.println("stuff") sickagents.add(n
ew SickAgent(numclasses,healthyagents.get(posinfe
ctedx).getSchedule(),period)) healthyagents.re
move(posinfectedx) numhealthy-- numsick
for(int yxylttempnuminfectedy)? if(posinfect
edygtposinfectedx)? posinfectedy--
8checkrecovery()?
public void checkrecovery()? for(int
x0xltnumsickx)? if(sickagents.get(x).getI
nfectionTime()0)? healthyagents.add(new
HealthyAgent(numclasses,sickagents.get(x).getSch
edule(),period)) sickagents.remove(x) numrec
overies numsick-- numhealthy
9SickAgent
public SickAgent(int numclasses) schedulenew
int8 for(int x0 xlt8x)?
schedulex(int)(Math.random()numclasses
) myposschedule0
infectionpercent5 infectiontime82
10Results
- According to my program in its current state
everyone will be pretty much permanently sick - When starting with 30 healthy and 1 sick agent
they were all sick within 4 steps - Arbitrarily choosing the chance of infection does
not give good results