observations.jl 902 Bytes
Newer Older
1
2
3
4
5
6
7

abstract type AbstractTrajectory end
ContinuousObservations = AbstractVector{AbstractTrajectory}

struct Trajectory <: AbstractTrajectory
    m::ContinuousTimeModel
    values::AbstractMatrix{Real}
8
    times::AbstractVector{Real}
Bentriou Mahmoud's avatar
Bentriou Mahmoud committed
9
    transitions::AbstractVector{Union{String,Nothing}}
10
11
12
13
14
end

function +(σ1::AbstractTrajectory,σ2::AbstractTrajectory) end
function -(σ1::AbstractTrajectory,σ2::AbstractTrajectory) end
function δ(σ1::AbstractTrajectory,t::Real) end
15
16
17
function get_obs_variables(σ::AbstractTrajectory) end

get_values(σ::AbstractTrajectory, var::String) = 
Bentriou Mahmoud's avatar
Bentriou Mahmoud committed
18
19
20
21
σ.values[(σ.m)._map_obs_var_idx[var],:] 

get_states_number(σ::AbstractTrajectory) =
length(σ.times)
22
23
24
25
26
27
28
29
30
31

function getindex(σ::AbstractTrajectory, idx::String)
    if idx  == "times"
        return σ.times
    elseif idx == "transitions"
        return σ.transitions
    else
        return get_values(σ, idx)
    end
end
32