multiple_long_sim_er.jl 1.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

using BenchmarkTools
BenchmarkTools.DEFAULT_PARAMETERS.samples = 20000

nb_sim = 1000

println("Pygmalion:")

using pygmalion
str_m = "enzymatic_reaction"
str_d = "abc_er"
pygmalion.load_model(str_m)
str_oml = "P,R,time"
ll_om = split(str_oml, ",")
x0 = State(95.0, 95.0, 0.0, 0.0, 0.0, 0.0)
16
p_true = Parameters(0.2, 40.0, 1.0)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
u = Control(20.0)
tml = 1:400
g_all = create_observation_function([ObserverModel(str_oml, tml)]) 
@timev pygmalion.simulate(f, g_all, x0, u, p_true; on = nothing, full_timeline = true)

b1_pyg = @benchmark for i=1:$(nb_sim) pygmalion.simulate($f, $g_all, $x0, $u, $p_true; on = nothing, full_timeline = true) end
b2_pyg = @benchmark for i=1:$(nb_sim) pygmalion.simulate(f, g_all, x0, u, p_true; on = nothing, full_timeline = true) end
@show minimum(b1_pyg), mean(b1_pyg), maximum(b1_pyg)
@show minimum(b2_pyg), mean(b2_pyg), maximum(b2_pyg)

println("MarkovProcesses:")

using MarkovProcesses
MarkovProcesses.load_model("ER")
ER.time_bound = 20.0
32
33
34
ER.estim_min_states = 7000
set_param!(ER, "k1", 0.2)
set_param!(ER, "k2", 40.0)
35
36
@timev MarkovProcesses.simulate(ER)

37
38
39
40
41
42
43
println("Default buffer size=10")
b1 = @benchmark for i=1:$(nb_sim) MarkovProcesses.simulate($ER) end
b2 = @benchmark for i=1:$(nb_sim) MarkovProcesses.simulate(ER) end
@show minimum(b1), mean(b1), maximum(b1)
@show minimum(b2), mean(b2), maximum(b2)
println("Buffer size 100")
ER.buffer_size = 100
44
45
b1_100 = @benchmark for i=1:$(nb_sim) MarkovProcesses.simulate($ER) end
b2_100 = @benchmark for i=1:$(nb_sim) MarkovProcesses.simulate(ER) end
46
47
@show minimum(b1_100), mean(b1_100), maximum(b1_100)
@show minimum(b2_100), mean(b2_100), maximum(b2_100)
48