Commit fadb5929 authored by Bentriou Mahmoud's avatar Bentriou Mahmoud
Browse files

Small restruction in Cosmos tests.

Add of set_time_bound!
Add of a first notebook example to explain the package.
parent 2a9d3b72
......@@ -22,6 +22,7 @@ export load_automaton, get_index, get_value, length_var, isaccepted
# Model related methods
export simulate, set_param!, get_param, set_observed_var!
export set_time_bound!
export isbounded, isaccepted, check_consistency
export load_model, get_module_path
......
......@@ -139,4 +139,5 @@ end
set_param!(m::ContinuousTimeModel, p::Vector{Float64}) = (m.p = p)
set_param!(m::ContinuousTimeModel, name_p::String, p_i::Float64) = (m.p[m.map_param_idx[name_p]] = p_i)
get_param(m::ContinuousTimeModel) = m.p
set_time_bound!(m::ContinuousTimeModel, b::Float64) = (m.time_bound = b)
......@@ -39,7 +39,7 @@ for exp in l_exp
for i in 1:nb_param
# Cosmos estimation
k3 = l_k3[i]
command = `Cosmos $(absolute_path * "distance_F/" * str_model * ".gspn")
command = `Cosmos $(absolute_path * "models/" * str_model * ".gspn")
$(absolute_path * "distance_F/dist_F_" * str_model * ".lha") --njob $(ENV["JULIA_NUM_THREADS"])
--const k_3=$(k3),x1=$x1,x2=$x2,t1=$t1,t2=$t2
--level $(level) --width $(width)
......
const double ki = 0.0012;
const double kr = 0.05;
NbPlaces = 3;
NbTransitions = 2;
PlacesList ={ S, I, R };
TransitionsList ={ Infection, Recovery };
Marking={
(S, 95);
(I, 5);
(R, 0);
};
Transitions ={
(Infection, EXPONENTIAL(ki*S*I), 1, 1, SINGLE);
(Recovery, EXPONENTIAL(kr*I), 1, 1, SINGLE);
};
InArcs ={
(S, Infection, 1);
(I, Infection, 1);
(I, Recovery, 1);
};
OutArcs ={
(Infection, I, 2);
(Recovery, R, 1);
};
Supports Markdown
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