Skip to content

Commit cff242e

Browse files
committed
changes for fixed lag
1 parent f8de82c commit cff242e

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

src/NeedsAHome.jl

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
export hasFactor, hasVariable
2+
export hasFactor, hasVariable, isInitialized
33

44
"""
55
$SIGNATURES
@@ -18,3 +18,25 @@ Return `::Bool` on whether `dfg` contains the variable `lbl::Symbol`.
1818
function hasVariable(dfg::G, label::Symbol)::Bool where {G <: AbstractDFG}
1919
return haskey(dfg.labelDict, label) # haskey(vertices(dfg.g), label)
2020
end
21+
22+
23+
"""
24+
$SIGNATURES
25+
26+
Returns state of vertex data `.initialized` flag.
27+
28+
Notes:
29+
- used by both factor graph variable and Bayes tree clique logic.
30+
TODO: Refactor
31+
"""
32+
function isInitialized(var::DFGVariable; key::Symbol=:default)::Bool
33+
return var.solverDataDict[key].initialized
34+
end
35+
function isInitialized(fct::DFGFactor; key::Symbol=:default)::Bool
36+
return fct.solverDataDict[key].initialized
37+
end
38+
function isInitialized(dfg::G, label::Symbol; key::Symbol=:default)::Bool where G <: AbstractDFG
39+
# nothing to do for factors
40+
# return dfg.g.vertices[dfg.labelDict[label]].dfgNode.solverDataDict[key].initialized
41+
return true
42+
end

src/services/GraphsDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function addFactor!(dfg::GraphsDFG, variables::Vector{DFGVariable}, factor::DFGF
137137
Graphs.add_edge!(dfg.g, edge)
138138
end
139139
# Track insertion
140-
push!(dfg.addHistory, factor.label)
140+
# push!(dfg.addHistory, factor.label)
141141

142142
return true
143143
end

test/interfaceTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ end
2121
@test ls(dfg, r"a") == [v1]
2222
@test lsf(dfg, r"f*") == [f1]
2323
# Accessors
24-
@test getAddHistory(dfg) == [:a, :b, :f1]
24+
@test getAddHistory(dfg) == [:a, :b] #, :f1
2525
@test getDescription(dfg) != nothing
2626
@test getLabelDict(dfg) != nothing
2727
# Existence

0 commit comments

Comments
 (0)