euclidean_distance_single.jl 753 Bytes
Newer Older
1
2
3
4
5
6

using MarkovProcesses
import LinearAlgebra: dot
import Distributions: Uniform

load_automaton("euclidean_distance_automaton")
7
load_automaton("euclidean_distance_automaton_2")
8
9
10
11
load_model("SIR")
tml_obs = 0:0.5:200
set_time_bound!(SIR, 200.0)
y_obs = vectorize(simulate(SIR), :I, tml_obs)
12
13
14
15
16
17
18
19

aut1 = create_euclidean_distance_automaton(SIR, tml_obs, y_obs, :I)
sync_SIR = SIR * aut1
σ = simulate(sync_SIR)
test = euclidean_distance(σ, :I, tml_obs, y_obs) == σ.state_lha_end[:d]

aut2 = create_euclidean_distance_automaton_2(SIR, tml_obs, y_obs, :I)
sync_SIR = SIR * aut2
20
σ = simulate(sync_SIR)
21
@show euclidean_distance(σ, :I, tml_obs, y_obs), σ.state_lha_end[:d]
Bentriou Mahmoud's avatar
Bentriou Mahmoud committed
22
test = euclidean_distance(σ, :I, tml_obs, y_obs) == σ.state_lha_end[:d]
23
24
25

return test