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

Modification of print of models + renaming macro for creation of models in...

Modification of print of models + renaming macro for creation of models in order to be more inclusive.
parent 2e2b5c9c
No related branches found
No related tags found
No related merge requests found
......@@ -41,14 +41,14 @@ export load_model, load_automaton, load_plots
export automaton_abc, abc_smc
# About biochemical networks
export @biochemical_network
export @network_model
include("common.jl")
include("trajectory.jl")
include("lha.jl")
include("model.jl")
include("utils.jl")
include("biochemical_network.jl")
include("network_model.jl")
include("../algorithms/abc_smc.jl")
end
......
......@@ -378,6 +378,10 @@ function Base.show(io::IO, m::ContinuousTimeModel)
for i in eachindex(m.g)
print(io, "* $(m.g[i]) (idx = $i in observed state space)\n")
end
print(io, "p = $(m.p)\n")
print(io, "x0 = $(m.x0) (in full state space)\n")
print(io, "t0 = $(m.t0)\n")
print(io, "time bound = $(m.time_bound)")
end
isbounded(m::Model) = get_proba_model(m).time_bound < Inf
......
......@@ -35,7 +35,7 @@ function get_str_propensity(propensity::Symbol, dict_species::Dict, dict_params:
return str_propensity
end
macro biochemical_network(expr_network,expr_name...)
macro network_model(expr_network,expr_name...)
model_name = isempty(expr_name) ? "Unnamed macro generated" : expr_name[1]
transitions = String[]
dict_species = Dict{String,Int}()
......
......@@ -26,7 +26,7 @@ using Test
@test include("unit/load_module.jl")
@test include("unit/long_sim_er.jl")
@test include("unit/macro_biochemical_network.jl")
@test include("unit/macro_network_model.jl")
@test include("unit/model_prior.jl")
@test include("unit/models_exps_er_1d.jl")
@test include("unit/observe_all.jl")
......
using MarkovProcesses
model_SIR = @biochemical_network begin
model_SIR = @network_model begin
R1: (S+I => 2I, ki*S*I)
R2: (I => R, kr*I)
end "SIR"
set_x0!(model_SIR, [95,5,0])
set_param!(model_SIR, [0.012, 0.05])
model_unnamed_SIR = @biochemical_network begin
model_unnamed_SIR = @network_model begin
R1: (S+I => 2I, ki*S*I)
R2: (I => R, kr*I)
end
set_x0!(model_unnamed_SIR, [95,5,0])
set_param!(model_unnamed_SIR, [0.012, 0.05])
model_ER = @biochemical_network begin
model_ER = @network_model begin
R1: (E+S => ES, k1*E*S)
R2: (ES => E+S, k2*ES)
R3: (ES => E+P, k3*ES)
......@@ -26,17 +26,17 @@ set_param!(model_ER, [1.0,1.0,1.0])
return true
#=
@biochemical_network "test1" begin
@network_model "test1" begin
R1: (S+I => 2I+Z, ki*S*I)
R2: (I => R, kr*I)
end
@biochemical_network "test2" begin
@network_model "test2" begin
R1: (S+I => 2I, ki*S*I)
R2: (I => R, kr*I)
end
@biochemical_network "test3" begin
@network_model "test3" begin
R1: (S+I => I, ki)
R2: (2I => R, kr*I*c)
end
......
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