-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (36 loc) · 1.15 KB
/
index.html
File metadata and controls
47 lines (36 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Epidemic Simulator</title>
<script type="text/javascript" src="js/outbreak.js"></script>
<script type="text/javascript" src="js/person.js"></script>
</head>
<body>
</body>
<script>
var modelParams = {
startingPopulation : 10000,
startingPopulationSusceptiblePercent : 100,
daysTillResolution : 16,
rNought : 1
};
function seedOutbreak(peopleCount, startingPopulationSusceptiblePercent, rNought, daysTillResolution) {
let people = [];
for(let i=0; i<peopleCount; i++) {
people.push(new Person(40,startingPopulationSusceptiblePercent,daysTillResolution));
}
let outbreak = new Outbreak(people,startingPopulationSusceptiblePercent,rNought);
return outbreak;
}
function kickOff(startingInfected, outbreak) {
outbreak.infectSomePeople(startingInfected);
outbreak.playOut();
return outbreak;
}
function simulate(startingInfected) {
let outbreak = seedOutbreak(modelParams.startingPopulation,modelParams.startingPopulationSusceptiblePercent, modelParams.rNought, modelParams.daysTillResolution);
return kickOff(startingInfected,outbreak);
}
</script>
</html>