@@ -72,9 +72,11 @@ mutable struct PackedVariableNodeData
7272end
7373
7474struct VariableEstimate
75- estimate :: Vector{Float64}
75+ solverKey :: Symbol
7676 type:: Symbol
77- key:: Symbol
77+ estimate:: Vector{Float64}
78+ lastUpdatedTimestamp:: DateTime
79+ VariableEstimate (solverKey:: Symbol , type:: Symbol , estimate:: Vector{Float64} , lastUpdatedTimestamp:: DateTime = now ()) = new (solverKey, type, estimate, lastUpdatedTimestamp)
7880end
7981
8082"""
@@ -85,14 +87,14 @@ mutable struct DFGVariable <: DFGNode
8587 label:: Symbol
8688 timestamp:: DateTime
8789 tags:: Vector{Symbol}
88- estimateDict:: Dict{Symbol, VariableEstimate}
90+ estimateDict:: Dict{Symbol, Dict{Symbol, VariableEstimate} }
8991 solverDataDict:: Dict{Symbol, VariableNodeData}
9092 smallData:: Dict{String, String}
9193 bigData:: Any
9294 ready:: Int
9395 backendset:: Int
9496 _internalId:: Int64
95- DFGVariable (label:: Symbol , _internalId:: Int64 ) = new (label, now (), Symbol[], Dict {Symbol, VariableEstimate} (), Dict {Symbol, VariableNodeData} (:default => VariableNodeData ()), Dict {String, String} (), nothing , 0 , 0 , _internalId)
97+ DFGVariable (label:: Symbol , _internalId:: Int64 ) = new (label, now (), Symbol[], Dict {Symbol, Dict{Symbol, VariableEstimate} } (), Dict {Symbol, VariableNodeData} (:default => VariableNodeData ()), Dict {String, String} (), nothing , 0 , 0 , _internalId)
9698 DFGVariable (label:: Symbol ) = new (label, now (), Symbol[], Dict {Symbol, VariableEstimate} (), Dict {Symbol, VariableNodeData} (:default => VariableNodeData ()), Dict {String, String} (), nothing , 0 , 0 , 0 )
9799end
98100
@@ -102,11 +104,11 @@ timestamp(v::DFGVariable) = v.timestamp
102104tags (v:: DFGVariable ) = v. tags
103105estimates (v:: DFGVariable ) = v. estimateDict
104106estimate (v:: DFGVariable , key:: Symbol = :default ) = haskey (v. estimateDict, key) ? v. estimateDict[key] : nothing
105- # solverData(v::DFGVariable) = haskey(v.solverDataDict, :default) ? v.solverDataDict[:default] : nothing
106107solverData (v:: DFGVariable , key:: Symbol = :default ) = haskey (v. solverDataDict, key) ? v. solverDataDict[key] : nothing
108+ getData (v:: DFGVariable ; solveKey:: Symbol = :default ):: VariableNodeData = v. solverDataDict[solveKey]
107109setSolverData (v:: DFGVariable , data:: VariableNodeData , key:: Symbol = :default ) = v. solverDataDict[key] = data
108110solverDataDict (v:: DFGVariable ) = v. solverDataDict
109- id (v:: DFGVariable ) = v. _internalId
111+ internalId (v:: DFGVariable ) = v. _internalId
110112# Todo: Complete this.
111113smallData (v:: DFGVariable ) = v. smallData
112114bigData (v:: DFGVariable ) = v. bigData
0 commit comments