read_trajectory_last_state_F.jl 682 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13

using MarkovProcesses

load_model("SIR")
load_automaton("automaton_F")
SIR.time_bound = 120.0
x1, x2, t1, t2 = 0.0, Inf, 100.0, 120.0 

A_F = create_automaton_F(SIR, x1, x2, t1, t2, "I") # <: LHA

function test_last_state(A::LHA, m::ContinuousTimeModel)
    σ = simulate(m)
    Send = read_trajectory(A, σ)
14
    test = (get_state_from_time(σ, Send.time)[1] == Send["n"]) && (Send["d"] == 0)
15
16
17
18
19
20
21
22
23
24
25
26
27
    #=
    if !test
        @show Send
        @show get_state_from_time(σ, Send.time)
        error("tkt")
    end=#
    return test
end

test_all = true
nbr_sim = 10000
for i = 1:nbr_sim
    test = test_last_state(A_F, SIR)
28
    global test_all = test_all && test
29
30
31
32
end

return test_all