Skip to content
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

Merged
merged 6 commits into from
Jul 23, 2024
Merged

Conversation

viniciusjusten
Copy link
Contributor

@viniciusjusten viniciusjusten commented Jul 23, 2024

No description provided.

Comment on lines 26 to 43
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
Copy link
Member

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.

Comment on lines 58 to 73
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"))
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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

@viniciusjusten viniciusjusten merged commit 6dbeaf2 into master Jul 23, 2024
2 checks passed
@viniciusjusten viniciusjusten deleted the vj/add-folder-to-iis-and-lp branch July 23, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants