Initializing help system before first use

problem.setcbintsol

problem.setcbintsol


Purpose
Set a user callback to be called during MISLP when an integer solution is obtained
Synopsis

problem.setcbintsol(callback, data)

callback(prob, data)


Arguments
callback 
The function to be called when an integer solution is obtained.
prob 
The problem passed to the callback function.
data 
The user-defined object passed as Object to setcbintsol.
Example
The following example sets up a callback to be executed whenever an integer solution is found during MISLP:
cSol = []
p.setcbintsol(CBIntSol, cSol)
The following sample callback function saves the solution values for the integer solution just found:
def CBIntSol(prob, cSol):
  prob.getmipsol(x=cSol, None, None, None)}
Related topics