diff --git a/src/Algorithm/basic/solveipform.jl b/src/Algorithm/basic/solveipform.jl index 412faa7e4..6114833ba 100644 --- a/src/Algorithm/basic/solveipform.jl +++ b/src/Algorithm/basic/solveipform.jl @@ -246,8 +246,9 @@ function run!( optimizer = getoptimizer(spform, optimizer_id) cbdata = MathProg.PricingCallbackData(spform) - optimizer.user_oracle(cbdata) - + TO.@timeit Coluna._to "Pricing callback" begin + optimizer.user_oracle(cbdata) + end if cbdata.nb_times_dual_bound_set == 0 throw(MissingPricingDualBound()) elseif cbdata.nb_times_dual_bound_set > 1 diff --git a/src/Algorithm/colgen/default.jl b/src/Algorithm/colgen/default.jl index 749bacbbc..c59b016d3 100644 --- a/src/Algorithm/colgen/default.jl +++ b/src/Algorithm/colgen/default.jl @@ -532,6 +532,7 @@ function ColGen.insert_columns!(ctx::ColGenContext, phase, columns) # Then, we add the new columns (i.e. not in the pool). col_ids = VarId[] for sol in primal_sols_to_insert + #print(IOContext(stdout, :user_only => true), sol) col_id = insert_column!(master, sol, "MC") _set_column_cost!(master, col_id, phase) push!(col_ids, col_id) diff --git a/src/Algorithm/formstorages.jl b/src/Algorithm/formstorages.jl index 0b75cc626..3a461e3d0 100644 --- a/src/Algorithm/formstorages.jl +++ b/src/Algorithm/formstorages.jl @@ -242,18 +242,6 @@ record_type_from_key(::StaticVarConstrKey) = StaticVarConstrRecord ClB.storage_unit(::Type{StaticVarConstrUnit}, _) = StaticVarConstrUnit() -# function Base.show(io::IO, record::StaticVarConstrRecord) -# print(io, "[vars:") -# for (id, var) in record.vars -# print(io, " ", MathProg.getuid(id)) -# end -# print(io, ", constrs:") -# for (id, constr) in record.constrs -# print(io, " ", MathProg.getuid(id)) -# end -# print(io, "]") -# end - function ClB.record(::Type{StaticVarConstrRecord}, id::Int, form::Formulation, unit::StaticVarConstrUnit) @logmsg LogLevel(-2) string("Storing static vars and consts") record = StaticVarConstrRecord(Dict{ConstrId,ConstrState}(), Dict{VarId,StaticVarState}()) @@ -264,7 +252,7 @@ function ClB.record(::Type{StaticVarConstrRecord}, id::Int, form::Formulation, u end end for (id, var) in getvars(form) - if isaStaticDuty(getduty(id)) && isexplicit(form, var) && iscuractive(form, var) + if isaStaticDuty(getduty(id)) && iscuractive(form, var) && (isexplicit(form, var) || isaMasterRepDuty(getduty(id))) varstate = StaticVarState( getcurcost(form, var), getcurlb(form, var), @@ -302,7 +290,7 @@ function ClB.restore_from_record!( end end for (id, var) in getvars(form) - if isaStaticDuty(getduty(id)) && isexplicit(form, var) + if isaStaticDuty(getduty(id)) && (isexplicit(form, var) || isaMasterRepDuty(getduty(id))) @logmsg LogLevel(-4) "Checking " getname(form, var) if haskey(record.vars, id) if !iscuractive(form, var) diff --git a/src/MathProg/MathProg.jl b/src/MathProg/MathProg.jl index ff3e24e7e..18fb93d94 100644 --- a/src/MathProg/MathProg.jl +++ b/src/MathProg/MathProg.jl @@ -82,7 +82,7 @@ export AbstractFormulation, Formulation, create_formulation!, getvar, getvars, export Original, DwMaster, BendersMaster, DwSp, BendersSp # Methods related to duties -export isanArtificialDuty, isaStaticDuty, isaDynamicDuty, isanOriginalRepresentatives +export isanArtificialDuty, isaStaticDuty, isaMasterRepDuty, isaDynamicDuty, isanOriginalRepresentatives # Types and methods related to variables and constraints export Variable, Constraint, VarId, ConstrId, VarMembership, ConstrMembership, diff --git a/src/MathProg/duties.jl b/src/MathProg/duties.jl index a5ed60cfd..3961d07d0 100644 --- a/src/MathProg/duties.jl +++ b/src/MathProg/duties.jl @@ -140,6 +140,11 @@ function isaStaticDuty(duty::NestedEnum) duty <= BendSpTechnologicalConstr end +function isaMasterRepDuty(duty::NestedEnum) + return duty <= MasterRepPricingVar || + duty <= MasterRepPricingSetupVar +end + function isaDynamicDuty(duty::NestedEnum) return duty <= MasterCol || duty <= MasterBranchOnOrigVarConstr ||