Skip to content

Commit

Permalink
add xpress patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Feb 8, 2024
1 parent d993157 commit b5b6cf2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/optimization_container.jl
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,13 @@ function solve_impl!(container::OptimizationContainer, system::PSY.System)
optimizer_stats.sec_in_gc = @timed JuMP.optimize!(jump_model)
model_status = JuMP.primal_status(jump_model)
if model_status != MOI.FEASIBLE_POINT::MOI.ResultStatusCode
@error "Optimizer returned $model_status"
@error "Optimizer returned $model_status trying again"
JuMP.optimize!(jump_model)
model_status = JuMP.primal_status(jump_model)

Check warning on line 682 in src/core/optimization_container.jl

View check run for this annotation

Codecov / codecov/patch

src/core/optimization_container.jl#L680-L682

Added lines #L680 - L682 were not covered by tests
end

if model_status != MOI.FEASIBLE_POINT::MOI.ResultStatusCode
@error "Optimizer returned $model_status getting conflict"

Check warning on line 686 in src/core/optimization_container.jl

View check run for this annotation

Codecov / codecov/patch

src/core/optimization_container.jl#L686

Added line #L686 was not covered by tests
if get_calculate_conflict(get_settings(container))
compute_conflict!(container)
end
Expand Down Expand Up @@ -706,6 +712,8 @@ function compute_conflict!(container::OptimizationContainer)
JuMP.compute_conflict!(jump_model)
if MOI.get(jump_model, MOI.ConflictStatus()) != MOI.CONFLICT_FOUND
@error "No conflict could be found for the model. $(MOI.get(jump_model, MOI.ConflictStatus()))"

return

Check warning on line 716 in src/core/optimization_container.jl

View check run for this annotation

Codecov / codecov/patch

src/core/optimization_container.jl#L716

Added line #L716 was not covered by tests
end

for (key, field_container) in get_constraints(container)
Expand Down

0 comments on commit b5b6cf2

Please sign in to comment.