Skip to content
Snippets Groups Projects
Verified Commit 352b4605 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

raise warning for incorrect termination

parent f1ddc162
No related branches found
No related tags found
No related merge requests found
module BuildSequences
import JuMP: Model, optimizer_with_attributes, optimize!, AbstractJuMPScalar, value
import JuMP: Model, optimizer_with_attributes, optimize!, AbstractJuMPScalar, value, solution_summary, termination_status, LOCALLY_SOLVED, OPTIMAL
import Ipopt
import Juniper
import ..Scanners: Scanner
......@@ -55,6 +55,10 @@ function build_sequence(f::Function, scanner::Union{Nothing, Scanner}, model::Mo
sequence = f()
if optimise
optimize!(model)
if !(termination_status(model) in (LOCALLY_SOLVED, OPTIMAL))
@warn "Optimisation did not report successful convergence. Please check the output sequence."
println(solution_summary(model))
end
return fixed(sequence)
else
return sequence
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment