Skip to main content
FRAMES NO FRAMES

Class IloCP::Callback

Definition file: ilcp/cp.h
Map of IloCP::CallbackIloCP::CallbackIloCP::Callback
Class for search monitoring.

This class allows you to monitor different aspects of CP Optimizer's search process by being called upon different events. By overriding the virtual function invoke, you may define the behavior you wish. When the callback is invoked you may use getters on the IloCP object such as IloCP::getInfo, IloCP::getObjValues and IloCP::getObjBounds. You may also terminate the search by calling IloCP::abortSearch.

Note
Aside from calling IloCP::abortSearch, it is forbidden to call any function which changes CP Optimizer's state inside a call to invoke, for example member functions such as setParameter, extract, solve, refineConflict etc. should not be called.
Method Summary
public virtual voidinvoke(IloCP cp, Callback::Reason reason)
public ~Callback()
Inner Enumeration
Callback::Reason Enumerated type describing the reason for callback.
Method Detail

~Callback

public ~Callback()

Destructor. You should make sure to deallocate any memory here which your callback has allocated when it was created or during its execution.


invoke

public virtual void invoke(IloCP cp, Callback::Reason reason)

This member function is invoked by the passed CP object to perform the callback action. You should define a subclass of IloCP::Callback which overrides the behavior of this function.

The reason parameter indicates for which reason the callback is being invoked. The current list of reasons is:


Inner Enumeration Detail

Enumeration Reason

Definition file: ilcp/cp.h
Enumerated type describing the reason for callback.

This enumerated type comprises the different reasons for which a user callback can be invoked. An argument of this type is passed to IloCP::Callback::invoke. You can use it to control the behavior of your callback.

Fields

StartExtraction 
EndExtraction 
StartSearch 
StartInitialPropagation 
EndInitialPropagation 
Periodic 
ObjBound 
Solution 
Proof 
EndSearch 
Destruction 
StartSolve 
EndSolve