Use a custom linear relaxation for fpump#255
Open
this-josh wants to merge 13 commits intolanl-ansi:masterfrom
Open
Use a custom linear relaxation for fpump#255this-josh wants to merge 13 commits intolanl-ansi:masterfrom
this-josh wants to merge 13 commits intolanl-ansi:masterfrom
Conversation
If use we need to dissect it in a similar way to jump; hence, `jp.mip_model = model.options.mip_model.moi_backend.optimizer.model`
Check if a mip model has been provided, if so use it for the fpump
accidentally removed in 8db52d9
Author
|
@Wikunia here is the implementation I have, as mentioned in #255 I'm not convinced it it a good approach. It works as such: # build MINLP
_nl_solver = optimizer_with_attributes(Ipopt.Optimizer, "print_level" => 0)
juniper_opt = optimizer_with_attributes(Juniper.Optimizer, "nl_solver" => _nl_solver, "mip_solver" => HiGHS.Optimizer)
model = Model(juniper_opt)
@variable(model, a, integer=true)
@constraint(model, 0<=model[:a] <= 10)
@NLconstraint(model, model[:a] * abs(model[:a]) >=3)
@objective(model, Min, model[:a])
juniper_opt = optimizer_with_attributes(Juniper.Optimizer, "nl_solver" => _nl_solver, "mip_solver" => HiGHS.Optimizer, "time_limit"=>64)
# build MILP
mip = Model(juniper_opt)
@variable(mip, a, integer=true)
@constraint(mip, mip[:a] * mip[:a] ==0)
@constraint(mip, mip[:a] <= 10)
@objective(mip, Min, mip[:a])
set_silent(mip)
set_optimizer_attribute(model, "mip_model", mip)
optimize!(mip)
# set the MINLP to have the MILP model
set_optimizer_attribute(model, "mip_model", mip)
optimize!(model)Note six |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of #254