-
Notifications
You must be signed in to change notification settings - Fork 0
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
add folder to iis and lp #5
Conversation
src/optimize_helpers.jl
Outdated
if write_lp | ||
if t == 0 && s == 0 && iter == 0 | ||
str = "det_eq_model" | ||
else | ||
str = "model_stage_$(t)" | ||
if s != 0 | ||
str *= "_scenario_$(s)" | ||
end | ||
if iter != 0 | ||
str *= "_iteration_$(iter)" | ||
end | ||
end | ||
if file_dir != "" && !ispath(file_dir) | ||
mkdir(file_dir) | ||
end | ||
file = joinpath(file_dir, str) | ||
JuMP.write_to_file(model, string(file, ".lp")) | ||
end |
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.
Coloca isso numa função separada mais bonitinha.
src/optimize_helpers.jl
Outdated
if file_dir != "" && !ispath(file_dir) | ||
mkdir(file_dir) | ||
end | ||
str = "infeasible_model" | ||
if t != 0 | ||
str *= "_stage_$(t)" | ||
end | ||
if s != 0 | ||
str *= "_scenario_$(s)" | ||
end | ||
if iter != 0 | ||
str *= "_iteration_$(iter)" | ||
end | ||
file = joinpath(file_dir, str) | ||
print_conflict_to_file(model, file) | ||
JuMP.write_to_file(model, string(file, ".lp")) |
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.
coloca isso numa função tb
@@ -31,7 +31,7 @@ function serial_benders_simulate(; | |||
second_stage_modifier(model, inputs, s) | |||
end | |||
JuMP.optimize!(model) | |||
treat_termination_status(model, t, s) | |||
treat_termination_status(model, t, s, 0, simulation_options.logs_dir, simulation_options.write_lp) |
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.
eu faria de forma a passar treat_termination_status(model, simulation_options, t, s, 0)
e ai pega o que precisar la dentro
@@ -19,7 +19,7 @@ function serial_benders_train(; | |||
first_stage_model = first_stage_builder(state_variables_model, inputs) | |||
add_all_cuts!(first_stage_model, pool[t], policy_training_options) | |||
JuMP.optimize!(first_stage_model) | |||
treat_termination_status(first_stage_model, t, 0) | |||
treat_termination_status(first_stage_model, t, 0, progress.current_iteration, policy_training_options.logs_dir, policy_training_options.write_lp) |
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.
Mesma coisa aqui, passa model, policy_training_options, progress e as dimensões
No description provided.