Skip to content

Commit

Permalink
Finished pattern enumeration and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rrsadykov committed Dec 24, 2024
1 parent 86af31b commit 5e7e7c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/Algorithm/colgen/default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ end
function ColGen.optimize_master_lp_problem!(master, ctx::ColGenContext, env)
rm_input = OptimizationState(master, ip_primal_bound=ctx.current_ip_primal_bound)
opt_state = run!(ctx.restr_master_solve_alg, env, master, rm_input, ctx.restr_master_optimizer_id)
# print(get_best_lp_primal_sol(opt_state))
# print(IOContext(stdout, :user_only => true), get_best_lp_dual_sol(opt_state))
# print(master)
return ColGenMasterResult(opt_state)
end

Expand Down Expand Up @@ -754,8 +757,9 @@ function ColGen.optimize_pricing_problem!(ctx::ColGenContext, sp::Formulation{Dw
generated_columns = GeneratedColumn[]
for col in get_ip_primal_sols(opt_state)
# `subprob_var_contrib` includes contribution of non-robust cuts.
subprob_var_contrib = _subprob_var_contrib(ctx, col, stab_changes_mast_dual_sol, master_dual_sol)
subprob_var_contrib = _subprob_var_contrib(ctx, col, stab_changes_mast_dual_sol, master_dual_sol)
red_cost = subprob_var_contrib - lb_dual - ub_dual
#@show subprob_var_contrib, red_cost
push!(generated_columns, GeneratedColumn(col, red_cost))
if sc * best_red_cost > sc * red_cost
best_red_cost = red_cost
Expand Down
3 changes: 2 additions & 1 deletion src/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function optimize!(
# initialize all the units used by the algorithm and its child algorithms
Algorithm.initialize_storage_units!(reform, algorithm)

# print(IOContext(stdout, :user_only => true), reform)
print(IOContext(stdout, :user_only => true), reform)

algstate = Algorithm.run!(algorithm, env, reform, initstate)

Expand All @@ -104,6 +104,7 @@ function optimize!(
ip_primal_sols = get_ip_primal_sols(algstate)
if !isnothing(ip_primal_sols)
for sol in ip_primal_sols
#print(IOContext(stdout, :user_only => true), sol)
add_ip_primal_sol!(outstate, proj_cols_on_rep(sol))
end
end
Expand Down
6 changes: 3 additions & 3 deletions test/revise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ include("e2e_extra/run.jl")

listen_to_tests([
run_unit_tests,
run_integration_tests,
run_e2e_tests,
run_e2e_extra_tests
# run_integration_tests,
# run_e2e_tests,
# run_e2e_extra_tests
])

0 comments on commit 5e7e7c9

Please sign in to comment.