@@ -36,6 +36,12 @@ mutable struct VariableNodeData
36
36
new (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13)
37
37
end
38
38
39
+ struct VariableEstimate
40
+ estimate:: Vector{Float64}
41
+ type:: Symbol
42
+ key:: Symbol
43
+ end
44
+
39
45
"""
40
46
$(SIGNATURES)
41
47
Fundamental structure for a DFG variable.
@@ -44,12 +50,25 @@ mutable struct DFGVariable <: DFGNode
44
50
label:: Symbol
45
51
timestamp:: DateTime
46
52
tags:: Vector{Symbol}
47
- estimates:: Dict{Symbol, Vector{Float64}}
48
- variableData:: VariableNodeData
49
- # variableDatas::VND
53
+ estimateDict:: Dict{Symbol, VariableEstimate}
54
+ solverDataDict:: Dict{Symbol, VariableNodeData}
50
55
smallData:: Any
51
56
bigData:: Any
52
57
_internalId:: Int64
53
- DFGVariable (label:: Symbol , _internalId:: Int64 ) = new (label, now (), Symbol[], Dict {Symbol, Vector{Float64}} (), VariableNodeData ( ), nothing , nothing , _internalId)
54
- DFGVariable (label:: Symbol ) = new (label, now (), Symbol[], Dict {Symbol, Vector{Float64}} (), VariableNodeData ( ), nothing , nothing , 0 )
58
+ DFGVariable (label:: Symbol , _internalId:: Int64 ) = new (label, now (), Symbol[], Dict {Symbol, VariableEstimate} (), Dict {Symbol, VariableNodeData} ( :default => VariableNodeData () ), nothing , nothing , _internalId)
59
+ DFGVariable (label:: Symbol ) = new (label, now (), Symbol[], Dict {Symbol, VariableEstimate} (), Dict {Symbol, VariableNodeData} ( :default => VariableNodeData () ), nothing , nothing , 0 )
55
60
end
61
+
62
+ # Accessors
63
+ label (v:: DFGVariable ) = v. label
64
+ timestamp (v:: DFGVariable ) = v. timestamp
65
+ tags (v:: DFGVariable ) = v. tags
66
+ estimates (v:: DFGVariable ) = v. estimateDict
67
+ estimate (v:: DFGVariable , key:: Symbol ) = haskey (v. estimateDict, key) ? v. estimateDict[key] : nothing
68
+ solverData (v:: DFGVariable ) = haskey (v. solverDataDict, :default ) ? v. solverDataDict[:default ] : nothing
69
+ solverData (v:: DFGVariable , key:: Symbol ) = haskey (v. solverDataDict, key) ? v. solverDataDict[key] : nothing
70
+ solverDataDict (v:: DFGVariable ) = v. solverDataDict
71
+ id (v:: DFGVariable ) = v. _internalId
72
+ # Todo: Complete this.
73
+ smallData (v:: DFGVariable ) = v. smallData
74
+ bigData (v:: DFGVariable ) = v. bigData
0 commit comments