Skip to content

Commit 27469cc

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 3f71b2b + d2468e6 commit 27469cc

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed

epidemic_roman/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Susceptible-Infected-Recovered Disease Spread Model
2+
3+
Yet another Cell-DEVS implementation of the cellular automata model presented by [Hoya White et al.](https://www.sciencedirect.com/science/article/pii/S0096300306009295).
4+
However, rules have been re-interpreted by [Román Cárdenas](mailto:[email protected]).
5+
6+
7+
## How to run the model:
8+
9+
In the linux terminal, type:
10+
```shell
11+
> ./../cd++ -msir_roman.ma -lresults/sir_roman.log
12+
```

epidemic_roman/sir_roman.inc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#BeginMacro(recovery)
2+
0.4
3+
#EndMacro
4+
5+
6+
#BeginMacro(i_effect)
7+
min
8+
(
9+
(0,0)~sus,
10+
(0,0)~sus * $virulence *
11+
(
12+
(0,0)~infec + $connection * $movement / (0,0)~pop *
13+
(
14+
(1,0)~pop * (1,0)~infec + (-1,0)~pop * (-1,0)~infec +
15+
(0,1)~pop * (0,1)~infec + (0,-1)~pop * (0,-1)~infec
16+
)
17+
)
18+
)
19+
#EndMacro

epidemic_roman/sir_roman.ma

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include(sir_roman.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-roman-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_roman.var
23+
24+
neighborports : initial infec rec pop sus
25+
26+
[sir-roman-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+
{
32+
$i_sus := round(((0,0)~sus - #macro(i_effect))*100)/100;
33+
$i_infec:= round(((1 - #macro(recovery)) * (0,0)~infec + (0,0)~sus - $i_sus)*100)/100;
34+
$i_rec := 1 - $i_sus - $i_infec;}
35+
1 { (0,0)~initial != -1 }

epidemic_roman/sir_roman.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_roman/sir_roman.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

0 commit comments

Comments
 (0)