diff --git a/src/Algorithm/basic/cutcallback.jl b/src/Algorithm/basic/cutcallback.jl index 89c25f819..d44b4ee32 100644 --- a/src/Algorithm/basic/cutcallback.jl +++ b/src/Algorithm/basic/cutcallback.jl @@ -38,7 +38,7 @@ function run!(algo::CutCallbacks, env::Env, form::Formulation, input::CutCallbac nb_ess_cuts = 0 nb_fac_cuts = 0 if length(robust_generators) > 0 && (algo.call_robust_facultative || algo.call_robust_essential) - !projection_is_possible(form) && error("Cannot do projection on original variables. Open an issue.") + !MathProg.projection_is_possible(form) && error("Cannot do projection on original variables. Open an issue.") projsol1 = proj_cols_on_rep(input.primalsol) projsol2 = Dict{VarId, Float64}(varid => val for (varid, val) in projsol1) diff --git a/src/Algorithm/benders/default.jl b/src/Algorithm/benders/default.jl index a232725bb..ba02758b1 100644 --- a/src/Algorithm/benders/default.jl +++ b/src/Algorithm/benders/default.jl @@ -127,7 +127,7 @@ function Benders.push_in_set!(ctx::BendersContext, set::CutsSet, sep_result::Ben return true end -function Benders.insert_cuts!(reform, ctx, cuts) +function Benders.insert_cuts!(reform, ctx::BendersContext, cuts) master = Benders.get_master(ctx) @show cuts diff --git a/src/Algorithm/branchcutprice.jl b/src/Algorithm/branchcutprice.jl index 653878b54..2679210d8 100644 --- a/src/Algorithm/branchcutprice.jl +++ b/src/Algorithm/branchcutprice.jl @@ -110,10 +110,8 @@ function BranchCutAndPriceAlgorithm(; BranchingPhase(first(stbranch_phases_num_candidates), RestrMasterLPConquer(), ProductScore()) ) if length(stbranch_phases_num_candidates) >= 3 - colgen = ColumnGeneration( pricing_prob_solve_alg = SolveIpForm( - optimizer_id = tuple.solverid, user_params = UserOptimize(), moi_params = MoiOptimize( deactivate_artificial_vars = false, diff --git a/src/Algorithm/branching/branchingalgo.jl b/src/Algorithm/branching/branchingalgo.jl index 7368fda6b..1e44360b9 100644 --- a/src/Algorithm/branching/branchingalgo.jl +++ b/src/Algorithm/branching/branchingalgo.jl @@ -50,7 +50,7 @@ struct ClassicBranching <: AlgoAPI.AbstractDivideAlgorithm end -struct BranchingContext{SelectionCriterion<:Branching.AbstractSelectionCriterion} <: Branching.AbstractDivideContext +struct BranchingContext{SelectionCriterion<:Branching.AbstractSelectionCriterion} <: Branching.AbstractBranchingContext selection_criterion::SelectionCriterion rules::Vector{Branching.PrioritisedBranchingRule} max_nb_candidates::Int diff --git a/src/Algorithm/branching/interface.jl b/src/Algorithm/branching/interface.jl index 2c292d7b8..7ec06dd77 100644 --- a/src/Algorithm/branching/interface.jl +++ b/src/Algorithm/branching/interface.jl @@ -6,16 +6,16 @@ end Branching.get_children(output::DivideOutput) = output.children Branching.get_opt_state(output::DivideOutput) = output.optstate -function get_extended_sol(::Branching.AbstractDivideContext, reform, opt_state) +function get_extended_sol(eform, opt_state) return get_best_lp_primal_sol(opt_state) end -function get_original_sol(::Branching.AbstractDivideContext, reform, opt_state) +function get_original_sol(reform, opt_state) extended_sol = get_best_lp_primal_sol(opt_state) master = getmaster(reform) original_sol = nothing if !isnothing(extended_sol) - original_sol = if projection_is_possible(master) + original_sol = if MathProg.projection_is_possible(master) proj_cols_on_rep(extended_sol) else get_best_lp_primal_sol(opt_state) # it means original_sol equals extended_sol(requires discussion) @@ -25,7 +25,7 @@ function get_original_sol(::Branching.AbstractDivideContext, reform, opt_state) end function Branching.projection_is_possible(::Branching.AbstractDivideContext, reform) - return projection_is_possible(getmaster(reform)) + return MathProg.projection_is_possible(getmaster(reform)) end function run!(algo::AlgoAPI.AbstractDivideAlgorithm, env::Env, reform::Reformulation, input::Branching.AbstractDivideInput) @@ -41,8 +41,8 @@ function run!(algo::AlgoAPI.AbstractDivideAlgorithm, env::Env, reform::Reformula return DivideOutput(SbNode[], optstate) end - extended_sol = get_extended_sol(ctx, reform, TreeSearch.get_opt_state(parent)) - original_sol = get_original_sol(ctx, reform, TreeSearch.get_opt_state(parent)) + extended_sol = get_extended_sol(reform, TreeSearch.get_opt_state(parent)) + original_sol = get_original_sol(reform, TreeSearch.get_opt_state(parent)) return Branching.run_branching!(ctx, env, reform, input, extended_sol, original_sol) end \ No newline at end of file diff --git a/src/Branching/Branching.jl b/src/Branching/Branching.jl index b0de2c3dd..f8d97c8bf 100644 --- a/src/Branching/Branching.jl +++ b/src/Branching/Branching.jl @@ -91,7 +91,9 @@ function select!(rule::AbstractBranchingRule, env, reform, input::Branching.Bran return BranchingRuleOutput(local_id, candidates) end -function advanced_select!(ctx::AbstractDivideContext, candidates, _, reform, input::AbstractDivideInput) +abstract type AbstractBranchingContext <: AbstractDivideContext end + +function advanced_select!(ctx::AbstractBranchingContext, candidates, _, reform, input::AbstractDivideInput) children = get_children(first(candidates)) return new_divide_output(children, nothing) end @@ -101,7 +103,7 @@ end ############################################################################################ # Implementation -"Supertype for the branching contexts." +"Supertype for the strong branching contexts." abstract type AbstractStrongBrContext <: AbstractDivideContext end "Supertype for the branching phase contexts." diff --git a/test/e2e/gap/generalized_assignment.jl b/test/e2e/gap/generalized_assignment.jl index a66acb613..bb37be0e8 100644 --- a/test/e2e/gap/generalized_assignment.jl +++ b/test/e2e/gap/generalized_assignment.jl @@ -23,7 +23,7 @@ function gap_toy_instance() @test MOI.get(model, MOI.NumberOfVariables()) == length(x) @test MOI.get(model, MOI.SolverName()) == "Coluna" end -register!(e2e_tests, "gap", gap_toy_instance; f = true) +register!(e2e_tests, "gap", gap_toy_instance) function gap_strong_branching() println("\e[45m gap strong branching \e[00m") @@ -61,7 +61,7 @@ function gap_strong_branching() @test JuMP.termination_status(model) == MOI.OPTIMAL @test ClD.GeneralizedAssignment.print_and_check_sol(data, model, x) end -register!(e2e_tests, "gap", gap_strong_branching; x = true) +register!(e2e_tests, "gap", gap_strong_branching) # @testset "Generalized Assignment" begin