Skip to content

Commit c05bbf0

Browse files
committed
model replicates the graph in the paper
1 parent e49134a commit c05bbf0

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

epidemic_hoya_et_al/SIR_Hoya.ma

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,40 @@ components : area
44

55
[area]
66
type : cell
7-
width : 21
8-
height : 21
7+
width : 50
8+
height : 50
99
delay : transport
10-
defaultDelayTime : 100
10+
defaultDelayTime : 1
1111
border : wrapped
1212
neighbors : area(-1,0)
1313
neighbors : area(0,-1) area(0,0) area(0,1)
1414
neighbors : area(1,0)
15-
initialvalue : 0
15+
initialvalue : -1
1616

1717

1818
localtransition : sir-hoya-rule
1919

20-
statevariables: population v c m
21-
statevalues: 10 0.6 1 1
20+
statevariables: population v c m i_infec i_rec i_sus
21+
statevalues: 100 0.6 1.0 0.5 0.0 0.0 1.0
22+
initialvariablesvalue: SIR_Hoya.var
2223

23-
24-
neighborports : value infec rec pop sus
24+
neighborports : initial infec rec pop sus
2525

2626
[sir-hoya-rule]
27-
rule : { ~pop := $population;
28-
~infec:= (1 - #macro(e)) * (0,0)~infec + $v*(0,0)~sus*(0,0)~infec + (0,0)~sus*#macro(effect_neighbours);
29-
~sus := (0,0)~sus - $v*(0,0)~sus*(0,0)~infec - (0,0)~sus*#macro(effect_neighbours);
30-
~rec := (0,0)~rec + #macro(e)*(0,0)~infec;
31-
} 100 { t }
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 + $v*(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+
3242

3343

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.7 0.0 0.3

epidemic_hoya_et_al/SIR_Hoya_macros.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#BeginMacro(e)
2-
0.5
2+
0.4
33
#EndMacro
44

55

0 commit comments

Comments
 (0)