Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

solver parameter not available in Mixed Integer Linear Programming

I'm getting the following error, while trying to set up IntegralityFocus for Gurobi backend in Sage 9.2:

sage: from sage_numerical_backends_gurobi.gurobi_backend import GurobiBackend as mysolver                                                                                                                                                               
sage: milp = MixedIntegerLinearProgram(solver=mysolver)                                                                                                                                                                                                 
sage: milp.solver_parameter("IntegralityFocus", 1)                                                                                                                                                                                                      
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
sage_numerical_backends_gurobi/gurobi_backend.pyx in sage_numerical_backends_gurobi.gurobi_backend.GurobiBackend.solver_parameter()

KeyError: 'IntegralityFocus'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-3-65373ae60dc1> in <module>
----> 1 milp.solver_parameter("IntegralityFocus", Integer(1))

/usr/local/SageMath.92/local/lib/python3.8/site-packages/sage/numerical/mip.pyx in sage.numerical.mip.MixedIntegerLinearProgram.solver_parameter (build/cythonized/sage/numerical/mip.c:16597)()
   2470             return self._backend.solver_parameter(name)
   2471         else:
-> 2472             self._backend.solver_parameter(name, value)
   2473 
   2474     cpdef sum(self, L):

sage_numerical_backends_gurobi/gurobi_backend.pyx in sage_numerical_backends_gurobi.gurobi_backend.GurobiBackend.solver_parameter()

ValueError: This parameter is not available. Enabling it may not be so hard, though.

Ok, it says "Enabling it may not be so hard, though." but HOW?