Skip to content

Commit 46f8eb8

Browse files
authored
Merge pull request #623 from mmghannam/master
Add ability to set priced variable score
2 parents ca5eec7 + 971a043 commit 46f8eb8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Add SCIP function SCIprowGetOriginCons
66
- Add getConsOriginConshdlrtype to Row
77
- Add possibility to use sine and cosing
8+
- Add ability to set priced variable score
89

910
### Fixed
1011
### Changed

src/pyscipopt/scip.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ cdef class Model:
14151415

14161416
# Variable Functions
14171417

1418-
def addVar(self, name='', vtype='C', lb=0.0, ub=None, obj=0.0, pricedVar = False):
1418+
def addVar(self, name='', vtype='C', lb=0.0, ub=None, obj=0.0, pricedVar=False, pricedVarScore=1.0):
14191419
"""Create a new variable. Default variable is non-negative and continuous.
14201420
14211421
:param name: name of the variable, generic if empty (Default value = '')
@@ -1425,6 +1425,7 @@ cdef class Model:
14251425
:param ub: upper bound of the variable, use None for +infinity (Default value = None)
14261426
:param obj: objective value of variable (Default value = 0.0)
14271427
:param pricedVar: is the variable a pricing candidate? (Default value = False)
1428+
:param pricedVarScore: score of variable in case it is priced, the higher the better (Default value = 1.0)
14281429
14291430
"""
14301431
cdef SCIP_VAR* scip_var
@@ -1457,7 +1458,7 @@ cdef class Model:
14571458
raise Warning("unrecognized variable type")
14581459

14591460
if pricedVar:
1460-
PY_SCIP_CALL(SCIPaddPricedVar(self._scip, scip_var, 1.0))
1461+
PY_SCIP_CALL(SCIPaddPricedVar(self._scip, scip_var, pricedVarScore))
14611462
else:
14621463
PY_SCIP_CALL(SCIPaddVar(self._scip, scip_var))
14631464

0 commit comments

Comments
 (0)