Skip to content

Commit 9d302cb

Browse files
Merge pull request #1 from SimulationEverywhere/epidemic_hoya_et_al
Epidemic hoya et al
2 parents 8a9ce71 + 28de2fe commit 9d302cb

File tree

4 files changed

+63
-24
lines changed

4 files changed

+63
-24
lines changed

epidemic_hoya_et_al/SIR_Hoya.ma

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,43 @@
1-
[top]
2-
components : population
3-
4-
[population]
5-
type : cell
6-
dim : (100,100)
7-
delay : transport
8-
defaultDelayTime : 1
9-
border : nowrapped
10-
neighbors : population(0,-1) population(0,0) population(0,1)
11-
neighbors : population(-1,0)
12-
neighbors : population(1,0)
13-
14-
initialvalue : 0
15-
InitialCellsValue : SIR_Hoya.val
16-
17-
localtransition : infections
18-
19-
[infections]
20-
21-
rule : {(0,0)} 1000 { t }
22-
23-
% neighbors : population(-1,-1) population(-1,0) population(-1,1)
24-
% neighbors : population(1,-1) population(1,0) population(1,1)
1+
#include(SIR_Hoya_macros.inc)
2+
[top]
3+
components : area
4+
5+
[area]
6+
type : cell
7+
width : 50
8+
height : 50
9+
delay : transport
10+
defaultDelayTime : 1
11+
border : wrapped
12+
neighbors : area(-1,0)
13+
neighbors : area(0,-1) area(0,0) area(0,1)
14+
neighbors : area(1,0)
15+
initialvalue : -1
16+
17+
18+
localtransition : sir-hoya-rule
19+
20+
statevariables: population virulence connection movement i_sus i_infec i_rec
21+
statevalues: 100 0.6 1.0 0.5 1.0 0.0 0.0
22+
initialvariablesvalue: SIR_Hoya.var
23+
24+
neighborports : initial infec rec pop sus
25+
26+
[sir-hoya-rule]
27+
rule : {~initial := 0; ~pop := $population; ~infec := $i_infec; ~sus := $i_sus; ~rec := $i_rec; }
28+
1 {(0,0)~initial = -1}
29+
30+
rule : {~pop := $population; ~infec := $i_infec; ~sus := $i_sus; ~rec := $i_rec; }
31+
{$i_infec:= trunc(min((1 - #macro(e)) * (0,0)~infec + $virulence*(0,0)~sus*(0,0)~infec + (0,0)~sus*#macro(effect_neighbours),1)*100)/100;
32+
$i_rec := trunc(min((0,0)~rec + #macro(e)*(0,0)~infec,1)*100)/100;
33+
$i_sus := 1 - $i_rec - $i_infec;}
34+
1 { (0,0)~initial != -1 }
35+
36+
37+
38+
39+
40+
41+
42+
43+

epidemic_hoya_et_al/SIR_Hoya.pal

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[-100; -0.001] 255 0 0
2+
[0; 0.200] 0 0 0
3+
[0.201; 0.400] 50 50 50
4+
[0.401; 0.600] 100 100 100
5+
[0.601; 0.800] 150 150 150
6+
[0.801; 1.00] 200 200 200
7+
[1.001;100] 255 0 0

epidemic_hoya_et_al/SIR_Hoya.var

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(25,25) = 10 0.6 1 1 0.3 0.7 0.0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#BeginMacro(e)
2+
0.4
3+
#EndMacro
4+
5+
6+
#BeginMacro(effect_neighbours)
7+
( ((1,0)~pop / $population) * (1,0)~infec * $virulence * $connection * $movement +
8+
((0,-1)~pop / $population) * (0,-1)~infec * $virulence * $connection * $movement +
9+
((0,1)~pop / $population) * (0,1)~infec * $virulence * $connection * $movement +
10+
((-1,0)~pop / $population) * (-1,0)~infec * $virulence * $connection * $movement )
11+
#EndMacro
12+

0 commit comments

Comments
 (0)