Skip to content
Snippets Groups Projects
Unverified Commit 2d8d9e4b authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Make up variables if needed

parent 49177280
No related branches found
No related tags found
1 merge request!2Define variables through new @defvar macro
module BuildSequences
import JuMP: Model, optimizer_with_attributes, optimize!, AbstractJuMPScalar, value, solution_summary, termination_status, LOCALLY_SOLVED, OPTIMAL, num_variables, all_variables, set_start_value, ALMOST_LOCALLY_SOLVED, objective_value
import JuMP: Model, optimizer_with_attributes, optimize!, AbstractJuMPScalar, value, solution_summary, termination_status, LOCALLY_SOLVED, OPTIMAL, num_variables, all_variables, set_start_value, ALMOST_LOCALLY_SOLVED, objective_value, INVALID_MODEL, @variable
import Ipopt
import Juniper
import ..Scanners: Scanner, gradient_strength, Default_Scanner
......@@ -65,6 +65,10 @@ function build_sequence(f::Function, scanner::Union{Nothing, Scanner}, model::Mo
end
end
optimize!(model)
while termination_status(model) == INVALID_MODEL
@variable(model, x[i=1:10])
optimize!(model)
end
if termination_status(model) in (LOCALLY_SOLVED, OPTIMAL)
if objective_value(model) < min_objective
min_objective = objective_value(model)
......
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