problem.addcbchgbranchobject
problem.addcbchgbranchobject |
Purpose
Declares a callback function that will be called every time the Optimizer has selected a global entity for branching. Allows the user to inspect and override the Optimizer's branching choice. This callback function will be called in addition to any callbacks already added by
problem.addcbchgbranchobject.
Synopsis
problem.addcbchgbranchobject(callback, data, priority)
newobject = callback(my_prob, my_object, obranch)
Arguments
callback
|
The callback function, which takes three arguments:
my_prob,
my_object, and
obranch. This function is called every time the Optimizer has selected a candidate entity for branching.
|
my_prob
|
The problem passed to the callback function,
callback.
|
my_object
|
The user defined object passed as
object when setting up the callback with
addcbchgbranchobject.
|
obranch
|
The candidate branching object selected by the Optimizer.
|
newobject
|
New branching object to replace the Optimizer's selection. Can be
None.
|
data
|
A user-defined object to be passed to the callback function,
callback.
|
priority
|
An integer that determines the order in which multiple callbacks of this type will be invoked. The callback added with a higher priority will be called before a callback with a lower priority. Set to 0 if not required.
|
Further information
1. The branching object given by the Optimizer provides a linear description of how the Optimizer intends to branch on the selected candidate. This will often be one of standard global entities of the current problem, but can also be e.g. a split disjunction or a structural branch, if those features are turned on.
2. The functions
branchobj.getbranches,
branchobj.getbounds and
branchobj.getrows can be used to inspect the given branching object.
3. Refer to the
branchobj class to learn how to create a new branching object to replace the Optimizer's selection. Note that the new branching object should be created with a priority value no higher than the current object to guarantee it will be used for branching.
Related topics