Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bentriou Mahmoud
MarkovProcesses.jl
Commits
ed25af50
Commit
ed25af50
authored
Jan 16, 2021
by
Bentriou Mahmoud
Browse files
small fix about read_trajectory
parent
da3146df
Changes
1
Show whitespace changes
Inline
Side-by-side
core/lha.jl
View file @
ed25af50
...
...
@@ -268,6 +268,7 @@ end
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
l_t
=
times
(
σ
)
l_tr
=
transitions
(
σ
)
Sn
=
init_state
(
A_new
,
σ
[
1
],
l_t
[
1
])
...
...
@@ -275,7 +276,7 @@ function read_trajectory(A::LHA, σ::Trajectory; verbose = false)
if
verbose
println
(
"Init: "
)
end
if
verbose
@show
Sn
end
for
n
in
2
:
length_states
(
σ
)
next_state!
(
Snplus1
,
A_new
,
σ
[
n
],
l_t
[
n
],
l_tr
[
n
],
Sn
,
σ
[
n
-
1
];
verbose
=
verbose
)
next_state!
(
Snplus1
,
A_new
,
σ
[
n
],
l_t
[
n
],
l_tr
[
n
],
Sn
,
σ
[
n
-
1
]
,
p_sim
;
verbose
=
verbose
)
copyto!
(
Sn
,
Snplus1
)
if
Snplus1
.
loc
in
A_new
.
locations_final
break
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment