Extensions to MBM and cutting planes techniques.#135
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #135 +/- ##
==========================================
+ Coverage 99.38% 99.51% +0.12%
==========================================
Files 17 17
Lines 1959 2063 +104
==========================================
+ Hits 1947 2053 +106
+ Misses 12 10 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pulsipher
left a comment
There was a problem hiding this comment.
See the comments below. Also, we will need some documentation on how these methods are handled for InfiniteModels (there is some nuance).
| function DP.copy_model_with_constraints( | ||
| model::InfiniteOpt.InfiniteModel, | ||
| constraints::Vector{<:DP.DisjunctConstraintRef}, | ||
| method::DP._MBM | ||
| ) |
There was a problem hiding this comment.
Based on the code I see below, there are a number of gotchas when it comes to copying InfiniteModels, I think we should instead implement JuMP.copy_model(model::InfiniteModel) in InfiniteOpt first to then use here.
There was a problem hiding this comment.
Noted, I'll try to get some code going before Monday's meeting and I can try for a PR after we chat.
| @@ -1,4 +1,4 @@ | |||
| using InfiniteOpt, HiGHS, Ipopt, Juniper | |||
| using InfiniteOpt, HiGHS, Ipopt, Juniper, Interpolations | |||
There was a problem hiding this comment.
What happens if this is not imported? It seems strange for the user to import a package they do not directly use.
There was a problem hiding this comment.
When it's not imported I have all test sets failing (not limited to just raw_M where its called).
MethodError: no method matching InfiniteGDPModel() The function InfiniteGDPModel exists, but no method is defined for this combination of argument types.
There was a problem hiding this comment.
This is because Julia extensions cannot have additional dependencies not included in the base package. And due to some type piracy in Interpolations, I do not want it to be a core dependency of InfiniteOpt or DisjunctiveProgramming. If you only use it for linear interpolation of M-values, perhaps it makes since to have a lightweight native function instead. It might even make sense just to use constant interpolation.
…_M_objective and raw_M in InfGDP
|
@pulsipher Tests are failing with |
This is b/c the master version was not be properly set up for testing on CI. However, InfiniteOpt v0.6.2 will be released in about 10 minutes, so just update the Project file to require 0.6.2 and you should be good to go. |
This PR makes changes to extend MBM and cutting planes techniques.
MBM
copy_model_with_constraints(::InfiniteModel, ...)prepare_max_M_objective(::InfiniteModel, ...)(LessThan + GreaterThan)raw_M(sub, ::Vector{<:AbstractJuMPScalar}, ::_MBM)Cutting Planes
copy_and_reformulate(::InfiniteModel, ..., ::CuttingPlanes)extract_solution(::InfiniteModel)add_cut(::InfiniteModel, ...)