-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing Env #443
Introducing Env #443
Conversation
Codecov Report
@@ Coverage Diff @@
## master #443 +/- ##
=======================================
Coverage 80.13% 80.14%
=======================================
Files 52 50 -2
Lines 4299 4301 +2
=======================================
+ Hits 3445 3447 +2
Misses 854 854
Continue to review full report at Codecov.
|
src/Algorithm/benders.jl
Outdated
@@ -51,14 +51,12 @@ end | |||
|
|||
getoptstate(data::BendersCutGenRuntimeData) = data.optstate | |||
|
|||
function run!(algo::BendersCutGeneration, rfdata::ReformData, input::OptimizationInput)::OptimizationOutput | |||
|
|||
function run!(algo::BendersCutGeneration, env::Env, rfdata::ReformData, input::OptimizationInput)::OptimizationOutput |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big line?
elapsed_time = @elapsed begin | ||
optresult = TO.@timeit Coluna._to "relaxed master" run!(SolveLpForm(get_dual_solution = true), ModelData(master), OptimizationInput(OptimizationState(master))) | ||
optresult = TO.@timeit Coluna._to "relaxed master" run!(SolveLpForm(get_dual_solution = true), env, ModelData(master), OptimizationInput(OptimizationState(master))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big line?
@@ -721,7 +725,10 @@ function cg_main_loop!( | |||
end | |||
end | |||
|
|||
print_colgen_statistics(phase, iteration, stabstorage.curalpha, cg_optstate, nb_new_columns, rm_time, sp_time) | |||
print_colgen_statistics( | |||
env, phase, iteration, stabstorage.curalpha, cg_optstate, nb_new_columns, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace?
sp_time += @elapsed begin | ||
nb_new_col = solve_sps_to_gencols!(spinfos, algo, phase, data, redcostsvec, lp_dual_sol, smooth_dual_sol) | ||
nb_new_col = solve_sps_to_gencols!( | ||
spinfos, algo, env, phase, data, redcostsvec, lp_dual_sol, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace?
node::Node, algo::AbstractConquerAlgorithm, env::Env, data::ReformData, | ||
storages_to_restore::StoragesUsageDict, opt_rtol::Float64 = Coluna.DEF_OPTIMALITY_RTOL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace?
) | ||
!haskey(annotations.constrs_per_ann, mast_ann) && return | ||
constrs = annotations.constrs_per_ann[mast_ann] | ||
for (id, constr) in constrs | ||
cloneconstr!( | ||
origform, masterform, masterform, constr, MasterMixedConstr, loc_art_var = true | ||
origform, masterform, masterform, constr, MasterMixedConstr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace?
src/decomposition.jl
Outdated
annotations::Annotations, | ||
mast_ann | ||
mast_ann, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra comma
@@ -136,7 +139,8 @@ function create_side_vars_constrs!( | |||
name = string("sp_lb_", spuid) | |||
lb_conv_constr = setconstr!( | |||
masterform, name, MasterConvexityConstr; | |||
rhs = lb_mult, kind = Essential, sense = Greater, inc_val = 100.0, loc_art_var = true | |||
rhs = lb_mult, kind = Essential, sense = Greater, inc_val = 100.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace?
@@ -145,16 +149,17 @@ function create_side_vars_constrs!( | |||
name = string("sp_ub_", spuid) | |||
ub_conv_constr = setconstr!( | |||
masterform, name, MasterConvexityConstr; rhs = ub_mult, | |||
kind = Essential, sense = Less, inc_val = 100.0, loc_art_var = true | |||
kind = Essential, sense = Less, inc_val = 100.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace?
src/decomposition.jl
Outdated
prob::Problem, annotations::Annotations, reform::Reformulation, parent, | ||
node::BD.Root | ||
prob::Problem, reform::Reformulation, env::Env, annotations::Annotations, parent, | ||
node::BD.Root, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra comma
I do not get the point of introducing environment. Is it just to store parameters? Storages are not global, they "belong" to a model, i.e. to the master, to a subproblem. We need to create a document explaining the architecture of Coluna so that the changes to architecture are clear. Where is a place for such a document? For the moment, we have models and algorithms. A model contain user data (formulation, etc) and computed data (storage). Algorithms are immutable and contain just the parameters, and they know child algorithms. I think it is good to have parameters local to algorithms. A user can pass either global parameters, which then are "localized" before solving (high-level usage). A user can also "fine-tune" local parameters of every algorithm, as it is done now (low-level usage). What is the advantage of having global parameters in an environment? |
I'm writing the document, I'll send you it when I finish the first version.
The main goal is to remove all global mutable variables such as |
In the future,
Env
will allows us to simplify algorithm architecture by moving storage in it