Initializing help system before first use

problem.setcbcascadeend

problem.setcbcascadeend


Purpose
Set a user callback to be called at the end of the cascading process, after the last variable has been cascaded
Synopsis

problem.setcbcascadeend(callback, data)

value = callback(prob, myobject)


Arguments
callback 
The function to be called at the end of the cascading process. callback returns an integer value. The return value is noted by Xpress SLP but it has no effect on the optimization.
prob 
The problem passed to the callback function.
myobject 
The user-defined object passed as data to setcbcascadeend.
data 
User-defined object, which can be used for any purpose by the function. data is passed to callback as my_object.
Example
The following example sets up a callback to be executed at the end of the cascading process which checks if any of the values have been changed significantly:
csol = [1,2,3,4]
p.setcbcascadeend(CBCascEnd, csol)
A suitable callback function might resemble this:
def CBCascEnd(prob, obj):
  for iCol in range(prob.controls.cols):
    (a,b,c,s,d,e,f,value,g,h,i,j,k,l,m,n) = prob.getvar(iCol)
    if abs(value - obj[iCol]) > .01:
      print("Col {0} changed from {1} to {2}".format(iCol, obj[iCol], value)
  return 0
The obj argument is used here to hold the original solution values.
Further information
This callback can be used at the end of the cascading, when all the solution values have been recalculated.
Related topics

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.