add python ClearHints method to CpSolver
This commit is contained in:
@@ -1539,9 +1539,14 @@ class CpModel(object):
|
||||
' is not a boolean variable')
|
||||
|
||||
def AddHint(self, var, value):
|
||||
"""Adds 'var == value' as a hint to the solver."""
|
||||
self.__model.solution_hint.vars.append(self.GetOrMakeIndex(var))
|
||||
self.__model.solution_hint.values.append(value)
|
||||
|
||||
def ClearHints(self):
|
||||
del self.__model.solution_hint.vars[:]
|
||||
del self.__model.solution_hint.values[:]
|
||||
|
||||
|
||||
def EvaluateLinearExpr(expression, solution):
|
||||
"""Evaluate a linear expression against a solution."""
|
||||
|
||||
Reference in New Issue
Block a user