From c6e0cefc1e35e211f956e1c6387336464fe3c36c Mon Sep 17 00:00:00 2001 From: Mahmoud Bentriou <mahmoud.bentriou@centralesupelec.fr> Date: Tue, 16 Feb 2021 11:12:29 +0100 Subject: [PATCH] small fix in synchronisation --- core/lha.jl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/lha.jl b/core/lha.jl index 4298e14..87ed3cd 100644 --- a/core/lha.jl +++ b/core/lha.jl @@ -135,7 +135,7 @@ function _get_edge_index(edge_candidates::Vector{Edge}, nbr_candidates::Int, edge = edge_candidates[i] # Asynchronous edge detection: we fire it if getfield(edge, :transitions)[1] == nothing - return (i, bool_event) + return (i, detected_event) end # Synchronous detection if !detected_event && tr_nplus1 != nothing @@ -269,10 +269,11 @@ function next_state!(Snplus1::StateLHA, A::LHA, end # For tests purposes -function read_trajectory(A::LHA, σ::Trajectory; verbose = false) - @assert (σ.m).dim_state == σ.m.dim_obs_state # Model should be entirely obserbed - A_new = LHA(A, (σ.m)._map_obs_var_idx) - p_sim = (σ.m).p +function read_trajectory(A::LHA, σ::AbstractTrajectory; verbose = false) + proba_model = get_proba_model(σ.m) + @assert proba_model.dim_state == proba_model.dim_obs_state # Model should be entirely obserbed + A_new = LHA(A, proba_model._map_obs_var_idx) + p_sim = proba_model.p l_t = times(σ) l_tr = transitions(σ) Sn = init_state(A_new, σ[1], l_t[1]) -- GitLab