From 42d14da029c0461f39d5d1ce6975d8ec68734818 Mon Sep 17 00:00:00 2001 From: Mohammed Ghannam Date: Sun, 6 Nov 2022 09:44:27 +0100 Subject: [PATCH 1/2] Add ability to set priced variable score --- src/pyscipopt/scip.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pyscipopt/scip.pyx b/src/pyscipopt/scip.pyx index 216574fd5..28b1a967a 100644 --- a/src/pyscipopt/scip.pyx +++ b/src/pyscipopt/scip.pyx @@ -1415,7 +1415,7 @@ cdef class Model: # Variable Functions - def addVar(self, name='', vtype='C', lb=0.0, ub=None, obj=0.0, pricedVar = False): + def addVar(self, name='', vtype='C', lb=0.0, ub=None, obj=0.0, pricedVar=False, pricedVarScore=1.0): """Create a new variable. Default variable is non-negative and continuous. :param name: name of the variable, generic if empty (Default value = '') @@ -1425,6 +1425,7 @@ cdef class Model: :param ub: upper bound of the variable, use None for +infinity (Default value = None) :param obj: objective value of variable (Default value = 0.0) :param pricedVar: is the variable a pricing candidate? (Default value = False) + :param pricedVarScore: score of variable in case it is priced, the higher the better (Default value = 1.0) """ cdef SCIP_VAR* scip_var @@ -1457,7 +1458,7 @@ cdef class Model: raise Warning("unrecognized variable type") if pricedVar: - PY_SCIP_CALL(SCIPaddPricedVar(self._scip, scip_var, 1.0)) + PY_SCIP_CALL(SCIPaddPricedVar(self._scip, scip_var, pricedVarScore)) else: PY_SCIP_CALL(SCIPaddVar(self._scip, scip_var)) From 971a043dcea47671737ce492d8f237c8fa0ffa10 Mon Sep 17 00:00:00 2001 From: Mohammed Ghannam Date: Sun, 6 Nov 2022 11:27:32 +0100 Subject: [PATCH 2/2] Update CHANGELOG (priced variable score) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0faa73e42..617116e00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Add SCIP function SCIprowGetOriginCons - Add getConsOriginConshdlrtype to Row - Add possibility to use sine and cosing +- Add ability to set priced variable score ### Fixed ### Changed