@@ -5339,7 +5339,7 @@ cdef class Model:
53395339
53405340 return pyCons
53415341
5342- def addConsIndicator (self , cons , binvar = None , activeone = True , name = " IndicatorCons " ,
5342+ def addConsIndicator (self , cons , binvar = None , activeone = True , name = " " ,
53435343 initial = True , separate = True , enforce = True , check = True ,
53445344 propagate = True , local = False , dynamic = False ,
53455345 removable = False , stickingatnode = False ):
@@ -5357,7 +5357,7 @@ cdef class Model:
53575357 activeone : bool, optional
53585358 constraint should active if binvar is 1 (0 if activeone = False)
53595359 name : str, optional
5360- name of the constraint (Default value = "IndicatorCons ")
5360+ name of the constraint (Default value = "")
53615361 initial : bool, optional
53625362 should the LP relaxation of constraint be in the initial LP? (Default value = True)
53635363 separate : bool, optional
@@ -5390,6 +5390,9 @@ cdef class Model:
53905390 if cons._lhs is not None and cons._rhs is not None :
53915391 raise ValueError (" expected inequality that has either only a left or right hand side" )
53925392
5393+ if name == ' ' :
5394+ name = ' c' + str (SCIPgetNConss(self ._scip)+ 1 )
5395+
53935396 if cons.expr.degree() > 1 :
53945397 raise ValueError (" expected linear inequality, expression has degree %d " % cons.expr.degree())
53955398
0 commit comments