forked from DLab/expander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.pka
74 lines (51 loc) · 2.69 KB
/
example.pka
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#Ciudades: name n1 n2 n3 ...
%loc: a 100 10 5 1
%loc: b 300 30 7 2
%loc: c 900 90 9 3
#Listas de ciudades, utiles para expandir reglas en subconjuntos de ciudades
%locl: a-b a b
%locl: ac a c
#Matrices de adyacencia entre ciudades
%locm: DM a b c
a 0 1 10
c 8 3 0
b 4 0 5
%locm:
TM a b c
a 0 2 3
b 2 0 5
c 3 4 0
%expand-agent: a-b S(s~1~2~3,x)
%expand-agent: all Z(x)
%expand-agent: DM T(x)
%expand-agent: all V(p,n,t~p~u)
%agent: Q(x,y,z)
%agent: R(r,s,t)
%expand-rule: all 'fight(%loc)' S(s~1,x),Z(x) -> \
S(x!1),Z(x!1) @ [log] 'var%loc' * %loc[1]
%expand-rule: a-b 'healing(%loc)' S(s~2,x!%loc[1]),Z(x!%loc[1]),Z() -> \
S(x),S(s~1,x),Z() @ 15.1
%expand-rule: all 'infecting(%loc)' S(),S(),S(),S(x!1,y!12),V(p!1,n!2,t~p!60),V(p!2,n!3,t~u!61),...,V(p!%loc[2],n!12),Z(),Z() -> Z() @ [inf]
%expand-rule: all 'infecting(%loc)' S(),S(),S(),S(x!1,y!12),V(p!1,n!2,t!60),V(p!2,n!3),...,V(p!11,n!12),Z(),Z() -> Z() @ [inf]
%expand-rule: all 'infecting(%loc)' S(),S(),S(),S(x!1,y!12),V(p!1,n!2),V(p!2,n!3,t!61),...,V(p!11,n!12),Z(),Z() -> Z() @ [inf]
%expand-rule: all 'infecting(%loc)' S(),S(),S(),S(x!1,y!12),V(p!1,n!2,t!60~u),V(p!2,n!3,t!_~u),...,V(p!11,n!12),Z(),Z() -> Z() @ [inf]
%expand-rule: all 'infecting(%loc)' S(),S(),S(),S(x!1,y!12),V(p!1,n!2,t!60),V(p!2,n!3,t?),...,V(p!11,n!12),Z(),Z() -> Z() @ [inf]
%expand-rule: all 'infecting(%loc)' S(),S(),S(),S(x!1,y!12),V(p!1,n!2,t!_),V(p!2,n!3,t!61),...,V(p!11,n!12),Z(),Z() -> Z() @ [inf]
%expand-rule: all 'infecting(%loc)' S(),S(),S(),S(x!1,y!12),V(p!1,n!2,t?),V(p!2,n!3,t!61),...,V(p!11,n!12),Z(),Z() -> Z() @ [inf]
%expand-rule: all 'infecting(%loc)' S(),S(),S(),S(x!1,y!12),V(p!1,n!2,t!51),V(p!2,n!3,t!61),...,V(p!11,n!12),Z(),Z() -> Z() @ [inf]
%expand-rule: DM 'diffusion(%org-%dst)' T(x),S(x) -> T(),S(%) @ '%orgdiffusion%dst' * %cell - %org[0] + %dst[1]
S(s~1) -> S(s~0) @ 1
'wake-up' S(s~0) -> S(s~1) @ 1
'test-chain' V(n!1),V(p!1,n!2),...,V(p!10) -> @ [inf]
#in the case of identical density among locs: expand-init: locl density agent
%expand-init: all 1000 S(s~%loc[3],x),S()
%expand-init: TM 4 * 5 - %cell T()
#specific for a loc
%init: 1 Z(loc~c),S()
%expand-obs: all 'name(%loc)' Z(x)
%expand-obs: all 'newvariable(%loc)' S(s~%loc[3],x)
%expand-obs: TM 'anotherName(%org,%dst)' T(x)
%expand-obs: TM 'anothernewvariable(%org,%dst)' T(x!%cell)
%expand-var: all 'halfZ(%loc)' 'name(%loc)' / 2
%expand-mod: all ([T] [mod] 10 = 0) do $ADD 1000 S(s~1,x) until [T] < 10000
%expand-mod: TM ([log] [E] > %org[0] && [T] < 10000) do 'diffusion(%org-%dst)' := 0