Skip to content

Commit 0ad9e81

Browse files
committed
add SolverParams
1 parent 8caa62b commit 0ad9e81

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/services/GraphsDFG.jl

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end
2727
vertex_index(v::GraphsNode) = v.index
2828

2929
# Exports
30-
export GraphsDFG
30+
export GraphsDFG, InMemoryParams
3131
export exists
3232
export getLabelDict, getDescription, setDescription, getInnerGraph, getAddHistory, getSolverParams, setSolverParams
3333

@@ -45,20 +45,37 @@ export getSubgraph
4545
export isFullyConnected, hasOrphans
4646
export toDot, toDotFile
4747

48-
mutable struct GraphsDFG <: AbstractDFG
48+
abstract type SolverParams end
49+
50+
mutable struct InMemoryParams <: SolverParams
51+
qfl::Int
52+
isfixedlag::Bool
53+
end
54+
55+
mutable struct GraphsDFG{T<:SolverParams} <: AbstractDFG
4956
g::FGType
5057
description::String
5158
nodeCounter::Int64
5259
labelDict::Dict{Symbol, Int64}
5360
addHistory::Vector{Symbol} #TODO: Discuss more - is this an audit trail?
54-
solverParams::Any # Solver parameters
61+
solverParams::T # Solver parameters
62+
end
63+
64+
function GraphsDFG(g::FGType,
65+
d::String,
66+
n::Int64,
67+
l::Dict{Symbol, Int64},
68+
a::Vector{Symbol},
69+
s::T=InMemoryParams(999999999, false)) where T <: SolverParams
70+
#
71+
GraphsDFG{T}(g, d, n, l, a, s)
5572
end
5673

5774
"""
5875
$(SIGNATURES)
5976
Create a new in-memory Graphs.jl-based DFG factor graph.
6077
"""
61-
GraphsDFG() = GraphsDFG(Graphs.incdict(GraphsNode,is_directed=false), "Graphs.jl implementation", 0, Dict{Symbol, Int64}(), Symbol[], nothing)
78+
GraphsDFG() = GraphsDFG(Graphs.incdict(GraphsNode,is_directed=false), "Graphs.jl implementation", 0, Dict{Symbol, Int64}(), Symbol[])
6279

6380
# Accessors
6481
getLabelDict(dfg::GraphsDFG) = dfg.labelDict

0 commit comments

Comments
 (0)