observations.jl 844 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
9
    times::AbstractVector{Real}
    transitions::AbstractVector{Union{String,Missing}}
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
18
19
20
21
22
23
24
25
26
27
28
function get_obs_variables(σ::AbstractTrajectory) end

get_values(σ::AbstractTrajectory, var::String) = 
    σ.values[(σ.m)._map_obs_var_idx[var],:] 

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