Opened 6 years ago
#20362 new enhancement
MIP backends: Make variable type consistent between add_variable, set_variable_type (with deprecation)
Reported by: | mkoeppe | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-7.2 |
Component: | numerical | Keywords: | lp |
Cc: | dimpase, vdelecroix, jdemeyer | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Status quo:
- add_variable uses 3 logical switches
binary=False, continuous=False, integer=False
(see #20324 regarding their defaulting behavior) - this matches the methods
is_variable_continuous
etc. set_variable_type
expresses the same thing using values 1, 0, -1.
Proposal (from #20354 discussion):
add_variable
there should take avariable_type
parameter, defaulting to'continuous'
, with other possible values'binary'
,'integer'
.- possibly deprecate the 3 switches
set_variable_type
should take the samevariable_type
values'continuous'
,'binary'
,'integer'
.- definitely deprecate values
1
,0
,-1
.
There are similar idiosyncrasies elsewhere in the backend interface (should be made separate tickets)
- Minimization is expressed as
maximization=False
in the constructor; asset_sense(-1)
; is queried byis_maximization
- ...
Note: See
TracTickets for help on using
tickets.