@@ -20,16 +20,17 @@ const FactorCache = AbstractFactorCache #
2020# #==============================================================================
2121
2222# TODO is this mutable
23- @kwdef mutable struct FactorState
24- eliminated:: Bool = false # TODO should eliminated and potentialused be moved outside of FactorState?
25- potentialused:: Bool = false # TODO ^
23+ @kwdef mutable struct Recipehyper
2624 multihypo:: Vector{Float64} = Float64[] # TODO re-evaluate after refactoring w #477
27- certainhypo:: Vector{Int} = Int[] # TODO mihgt be dead code?
2825 nullhypo:: Float64 = 0.0
29- # solveInProgress::Int = 0 #TODO maybe deprecated or move to operational memory, also why Int?
3026 inflation:: Float64 = 0.0
3127end
3228
29+ @kwdef mutable struct Recipestate
30+ eliminated:: Bool = false
31+ potentialused:: Bool = false
32+ end
33+
3334# #==============================================================================
3435# # Factors
3536# #==============================================================================
@@ -80,9 +81,10 @@ StructUtils.@kwarg struct FactorDFG{T <: AbstractObservation, N} <: AbstractGrap
8081 """ Observation function or measurement for this factor.
8182 Accessors: [`getObservation`](@ref)(@ref)"""
8283 observation:: T & (lower = pack_lower, choosetype = DFG. resolvePackedType)# TODO finalise serializd type
83- """ Describes the current state of the factor. Persisted in serialization.
84- Accessors: [`getFactorState`](@ref)"""
85- state:: FactorState = FactorState ()
84+ """ Hyperparameters associated with this factor."""
85+ hyper:: Recipehyper = Recipehyper ()
86+ """ Describes the current state of the factor. Persisted in serialization."""
87+ state:: Recipestate = Recipestate ()
8688 """ Temporary, non-persistent memory used internally by the solver for intermediate numerical computations and buffers.
8789 `solvercache` is lazily allocated and only used during factor operations; it is not serialized or retained after solving.
8890 Accessors: [`getCache`](@ref), [`setCache!`](@ref)"""
9698version (:: Type{<:FactorDFG} ) = v " 0.29.0"
9799
98100# #------------------------------------------------------------------------------
99- # # Constructors
101+ # # Constructors - IIF like
100102function FactorDFG (
101103 variableorder:: Union{<:Tuple, Vector{Symbol}} ,
102104 observation:: AbstractObservation ;
@@ -129,7 +131,8 @@ function FactorDFG(
129131 end
130132
131133 # create factor data
132- state = FactorState (; multihypo, nullhypo, inflation)
134+ hyper = Recipehyper (; multihypo, nullhypo, inflation)
135+ state = Recipestate ()
133136
134137 union! (tags, [:FACTOR ])
135138 # create factor
@@ -140,6 +143,7 @@ function FactorDFG(
140143 timestamp,
141144 solvable = Ref (solvable),
142145 bloblets,
146+ hyper,
143147 state,
144148 observation,
145149 )
@@ -152,7 +156,8 @@ function FactorDFG(
152156 label:: Symbol ,
153157 variableorder:: Union{Vector{Symbol}, Tuple} ,
154158 observation:: AbstractObservation ,
155- state:: FactorState = FactorState (),
159+ hyper:: Recipehyper = Recipehyper (),
160+ state:: Recipestate = Recipestate (),
156161 cache = nothing ;
157162 tags:: Set{Symbol} = Set {Symbol} ([:FACTOR ]),
158163 timestamp:: Union{DateTime, ZonedDateTime, TimeDateZone} = TimeDateZone (
@@ -194,6 +199,7 @@ function FactorDFG(
194199 Ref (solvable),
195200 bloblets,
196201 observation,
202+ hyper,
197203 state,
198204 solvercache,
199205 blobentries,
0 commit comments