Commit 66d44c7e authored by Bentriou Mahmoud's avatar Bentriou Mahmoud

update of notebooks according to the new simulation methods

parent 920cd91a
......@@ -10,7 +10,7 @@ import Distributed: @everywhere, @distributed
import Distributions: Product, Uniform, Normal
import Distributions: Distribution, Univariate, Continuous, UnivariateDistribution,
MultivariateDistribution, product_distribution
import Distributions: insupport, pdf
import Distributions: insupport, isbounded, pdf
import FunctionWrappers: FunctionWrapper
import Random: rand, rand!
import StaticArrays: SVector, @SVector
......
......@@ -271,15 +271,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.4.2",
"display_name": "Julia 1.5.3",
"language": "julia",
"name": "julia-1.4"
"name": "julia-1.5"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.4.2"
"version": "1.5.3"
}
},
"nbformat": 4,
......
......@@ -273,10 +273,17 @@
"outputs": [],
"source": [
"g_sir = [:I]\n",
"tryhard_sir = ContinuousTimeModel(dim_state_sir, dim_params_sir, \n",
"\n",
"# Generates simulate method for the new model\n",
"@everywhere @eval $(MarkovProcesses.generate_code_model_type_def(:TryhardSIRModel))\n",
"@everywhere @eval $(MarkovProcesses.generate_code_model_type_constructor(:TryhardSIRModel))\n",
"@everywhere @eval $(MarkovProcesses.generate_code_simulation(:TryhardSIRModel, :sir_f!, :sir_isabsorbing))\n",
"\n",
"\n",
"tryhard_sir = TryhardSIRModel(dim_state_sir, dim_params_sir, \n",
" map_var_idx_sir, map_params_idx_sir, \n",
" transitions_sir, p_sir, x0_sir, t0_sir, \n",
" getfield(Main, :sir_f!), getfield(Main, :sir_isabsorbing); g = g_sir, name = \"Handmade SIR\")"
" :sir_f!, :sir_isabsorbing; g = g_sir)"
]
},
{
......
......@@ -20,6 +20,7 @@
"\n",
"load_model(\"SIR\")\n",
"set_time_bound!(SIR, 100.0)\n",
"\n",
"parametric_SIR = ParametricModel(SIR, (:ki, Uniform(0.001, 0.0015)))\n",
"\n",
"vec_observations = [simulate(SIR)]\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment