Skip to content
Snippets Groups Projects
Commit 2732b520 authored by Bentriou Mahmoud's avatar Bentriou Mahmoud
Browse files

Add bench SIR sim pygmalion

parent 62e23fbf
No related branches found
No related tags found
No related merge requests found
using BenchmarkTools
using pygmalion
using MarkovProcesses
println("Pygmalion:")
str_m = "sir_ctmc"
str_d = "abc_sir_ctmc"
pygmalion.load_model(str_m)
str_oml = "X_I,R,time"
ll_om = split(str_oml, ",")
x0 = State(95.0, 5.0, 0.0, 0.0, 0.0)
p_true = Parameters(0.0012, 0.05)
u = Control(100.0)
tml = 1:400
g_all = create_observation_function([ObserverModel(str_oml, tml)])
b1_pyg = @benchmark pygmalion.simulate($f, $g_all, $x0, $u, $p_true; on = nothing, full_timeline = true)
b2_pyg = @benchmark pygmalion.simulate(f, g_all, x0, u, p_true; on = nothing, full_timeline = true)
@timev pygmalion.simulate(f, g_all, x0, u, p_true; on = nothing, full_timeline = true)
@show minimum(b1_pyg), mean(b1_pyg), maximum(b1_pyg)
@show minimum(b2_pyg), mean(b2_pyg), maximum(b2_pyg)
println("MarkovProcesses:")
MarkovProcesses.load_model("SIR")
SIR.time_bound = 100.0
b1 = @benchmark MarkovProcesses.simulate($SIR)
b2 = @benchmark MarkovProcesses.simulate(SIR)
@timev MarkovProcesses.simulate(SIR)
@show minimum(b1), mean(b1), maximum(b1)
@show minimum(b2), mean(b2), maximum(b2)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment