benchmark.jl 3.65 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
using ABMEv,UnPack

println("--------------------------------")
println("""TESTING GILLEPSIE with popoulation""")
println("--------------------------------")

for K0 in [10,50,100,500,1000,5000]
    myspace = (RealSpace{1,Float64}(),)
    sigma_K = .9;
    sigma_a = .7;
Victor's avatar
Victor committed
11
12
    b(X,t) = gaussian(X[1],0.,sigma_K)
    d(X,Y,t) = gaussian(X[1],Y[1],sigma_a)/K0
13
14
15
16
17
    D = (1e-2,)
    mu = [.1]
    NMax = 10000
    tend = 2
    p = Dict{String,Any}();@pack! p = d,b,D,mu,NMax
Victor's avatar
Victor committed
18
    myagents = [Agent(myspace,(0,),ancestors=false,rates=true) for i in 1:K0]
19
20
    w0 = World(myagents,myspace,p,0.)
    @show K0
Victor's avatar
Victor committed
21
    @time sim = run!(w0,Gillepsie(),tend,b,d)
22
23
24
25
26
27
28
29
30
end

println("--------------------------------")
println("""TESTING CFM with population""")
println("--------------------------------")
for K0 in [10,50,100,500,1000,5000]
    myspace = (RealSpace{1,Float64}(),)
    sigma_K = .9;
    sigma_a = .7;
Victor's avatar
Victor committed
31
32
    b(X,t) = gaussian(X[1],0.,sigma_K)
    d(X,Y,t) = gaussian(X[1],Y[1],sigma_a)/K0
33
34
35
36
    D = (1e-2,)
    mu = [.1]
    NMax = 10000
    tend = 2
Victor's avatar
Victor committed
37
38
39
    dm = d([0],[0],0.);bm = 1.
    p = Dict{String,Any}();@pack! p = dm,bm,D,mu,NMax,Cbar
    myagents = [Agent(myspace,(0,),ancestors=false) for i in 1:K0]
40
41
    w0 = World(myagents,myspace,p,0.)
    @show K0
Victor's avatar
Victor committed
42
    @time sim = run!(w0,CFM(),tend,b,d)
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
end

println("--------------------------------")
println("""TESTING CFM with population without ancestors""")
println("--------------------------------")
for K0 in [10,50,100,500,1000,5000]
    myspace = (RealSpace{1,Float64}(),)
    sigma_K = .9;
    sigma_a = .7;
    b(X) = gaussian(X[1],0.,sigma_K)
    d(X,Y) = gaussian(X[1],Y[1],sigma_a)/K0
    D = (1e-2,)
    mu = [.1]
    NMax = 10000
    tend = 2
    Cbar=2
Victor's avatar
Victor committed
59
    p = Dict{String,Any}();@pack! p = D,mu,NMax,Cbar
60
61
62
    myagents = [Agent(myspace,(0,),ancestors=true) for i in 1:K0]
    w0 = World(myagents,myspace,p,0.)
    @show K0
Victor's avatar
Victor committed
63
    @time sim = run!(w0,CFM(),tend,b,d)
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
end

println("--------------------------------")
println("""TESTING CFM with time""")
println("--------------------------------")

for tend in [1,10,50,100]
    K0 = 1000
    myspace = (RealSpace{1,Float64}(),)
    sigma_K = .9;
    sigma_a = .7;
    b(X) = gaussian(X[1],0.,sigma_K)
    d(X,Y) = gaussian(X[1],Y[1],sigma_a)/K0
    D = (1e-2,)
    mu = [.1]
    NMax = 10000
    Cbar=2
Victor's avatar
Victor committed
81
    p = Dict{String,Any}();@pack! p = D,mu,NMax,Cbar
82
83
84
    myagents = [Agent(myspace,(0,),ancestors=true) for i in 1:K0]
    w0 = World(myagents,myspace,p,0.)
    @show tend
Victor's avatar
Victor committed
85
    @time sim = run!(w0,CFM(),tend,b,d)
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
end

println("--------------------------------")
println("""TESTING CFM with time without Ancestors""")
println("--------------------------------")

for tend in [1,10,50,100]
    K0 = 1000
    myspace = (RealSpace{1,Float64}(),)
    sigma_K = .9;
    sigma_a = .7;
    b(X) = gaussian(X[1],0.,sigma_K)
    d(X,Y) = gaussian(X[1],Y[1],sigma_a)/K0
    D = (1e-2,)
    mu = [.1]
    NMax = 10000
    Cbar=2
Victor's avatar
Victor committed
103
    p = Dict{String,Any}();@pack! p = D,mu,NMax,Cbar
104
105
106
    myagents = [Agent(myspace,(0,)) for i in 1:K0]
    w0 = World(myagents,myspace,p,0.)
    @show tend
Victor's avatar
Victor committed
107
    @time sim = run!(w0,CFM(),tend,b,d)
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
end

println("--------------------------------")
println("""TESTING Gillepsie with time""")
println("--------------------------------")
for tend in [1,10,50,100]
    K0 = 1000
    myspace = (RealSpace{1,Float64}(),)
    sigma_K = .9;
    sigma_a = .7;
    b(X) = gaussian(X[1],0.,sigma_K)
    d(X,Y) = gaussian(X[1],Y[1],sigma_a)/K0
    D = (1e-2,)
    mu = [.1]
    NMax = 10000
    # Cbar=2
Victor's avatar
Victor committed
124
    p = Dict{String,Any}();@pack! p = D,mu,NMax #,Cbar
125
126
127
    myagents = [Agent(myspace,(0,),ancestors=true,rates=true) for i in 1:K0]
    w0 = World(myagents,myspace,p,0.)
    @show tend
Victor's avatar
Victor committed
128
    @time sim = run!(w0,Gillepsie(),tend,b,d)
129
end