FRAMES NO FRAMES

Class IlcTraceI

Definition file: ilsolver/ilctrace.h
Include file: <ilsolver/ilctrace.h>

An instance of this class is part of the Solver trace mechanism. It enables you to trace such events as failure of a variable, a demon, or a constraint in a solution search. With an instance of this class, you can access the modifications of an active demon or an active constraint at any time by calling the member functions:

Trace Events

Solver uses #define to define the events that you can trace with an instance of IlcTraceI:

#define IlcTraceDemons      ((IlcUInt)  1)
#define IlcTraceConstraint  ((IlcUInt)  2)
#define IlcTraceProcess     ((IlcUInt)  4)
#define IlcTraceVars        ((IlcUInt)  8)
#define IlcTraceFail        ((IlcUInt)  16)
#define IlcTraceNoEvent     ((IlcUInt)  32)
#define IlcTraceAllEvent    ((IlcUInt)  31)
 

When you use its constructor to create an instance of IlcTraceI, use one of those values to indicate which event or events to trace. After you have created a trace (an instance of IlcTraceI) if you want to alter the events that it traces, use the member functions setTraceDemon, setTraceConstraint, etc., to alter the trace.

See Also:

Constructor and Destructor Summary
public IlcTraceI(IloSolver s, IlcUInt flags, const char * name=0)
Method Summary
public virtual voidbeginAddRequired(const IlcIntSetVar var, IlcInt val)
public virtual voidbeginBoolVarProcess(const IlcConstraint constraint)
public virtual voidbeginConstraintPost(const IlcConstraint constraint)
public virtual voidbeginConstraintPropagate(const IlcConstraint constraint)
public virtual voidbeginDemonProcess(const IlcDemon demon)
public virtual voidbeginFloatVarProcess(const IlcFloatExp exp)
public virtual voidbeginIntSetVarProcess(const IlcIntSetVar var)
public virtual voidbeginIntVarProcess(const IlcIntExp exp)
public virtual voidbeginRemovePossible(const IlcIntSetVar var, IlcInt val)
public virtual voidbeginRemoveValueFloatVar(const IlcFloatExp, IlcFloat val)
public virtual voidbeginRemoveValueIntVar(const IlcIntExp exp, IlcInt val)
public virtual voidbeginSetMaxFloatVar(const IlcFloatExp exp, IlcFloat max)
public virtual voidbeginSetMaxIntVar(const IlcIntExp exp, IlcInt max)
public virtual voidbeginSetMinFloatVar(const IlcFloatExp exp, IlcFloat min)
public virtual voidbeginSetMinIntVar(const IlcIntExp exp, IlcInt min)
public virtual voidbeginSetValueFloatVar(const IlcFloatExp, IlcFloat val)
public virtual voidbeginSetValueIntVar(const IlcIntExp exp, IlcInt val)
public virtual voiddefineIlcOr(IlcInt nbOr)
public virtual voidendAddRequired(const IlcIntSetVar var, IlcInt val)
public virtual voidendBoolVarProcess(const IlcConstraint constraint)
public virtual voidendConstraintPost(const IlcConstraint constraint)
public virtual voidendConstraintPropagate(const IlcConstraint constraint)
public virtual voidendDemonProcess(const IlcDemon demon)
public virtual voidendFloatVarProcess(const IlcFloatExp exp)
public virtual voidendIntSetVarProcess(const IlcIntSetVar var)
public virtual voidendIntVarProcess(const IlcIntExp exp)
public virtual voidendRemovePossible(const IlcIntSetVar var, IlcInt val)
public virtual voidendRemoveValueFloatVar(const IlcFloatExp exp, IlcFloat val)
public virtual voidendRemoveValueIntVar(const IlcIntExp exp, IlcInt val)
public virtual voidendSetMaxFloatVar(const IlcFloatExp exp, IlcFloat max)
public virtual voidendSetMaxIntVar(const IlcIntExp exp, IlcInt max)
public virtual voidendSetMinFloatVar(const IlcFloatExp exp, IlcFloat min)
public virtual voidendSetMinIntVar(const IlcIntExp exp, IlcInt min)
public virtual voidendSetValueFloatVar(const IlcFloatExp exp, IlcFloat val)
public virtual voidendSetValueIntVar(const IlcIntExp exp, IlcInt val)
public virtual voidfailDemon(const IlcDemon demon)
public virtual voidfailFloatVar(const IlcFloatExp exp)
public virtual voidfailIntSetVar(const IlcIntSetVar var)
public virtual voidfailIntVar(const IlcIntExp exp)
public virtual voidfailManager(IlcInt nbFails)
public IlcDemongetActiveDemon()
public ostream &getStream() const
public IlcBoolisAllTraced() const
public IlcBoolisConstraintTraced() const
public IlcBoolisDemonTraced() const
public IlcBoolisFailTraced() const
public IlcBoolisNoneTraced() const
public IlcBoolisProcessTraced() const
public IlcBoolisVarTraced() const
public voidsetTraceAllEvents()
public voidsetTraceConstraint(IlcBool condition)
public voidsetTraceDemons(IlcBool condition)
public voidsetTraceFail(IlcBool condition)
public voidsetTraceNoEvent()
public voidsetTraceProcess(IlcBool condition)
public voidsetTraceVars(IlcBool condition)
public voidtrace(IlcAnySetVar) const
public voidtrace(IlcIntSetVar) const
public voidtrace(IlcFloatVar) const
public voidtrace(IlcAnyVar) const
public voidtrace(IlcIntVar) const
Constructor and Destructor Detail

IlcTraceI

public IlcTraceI(IloSolver s, IlcUInt flags, const char * name=0)

This constructor creates a trace for the solver s. The parameter flags indicates which events should be traced.


Method Detail

beginAddRequired

public virtual void beginAddRequired(const IlcIntSetVar var, IlcInt val)

Solver calls this member function when it begins to add the element val to the set of required elements of the set variable var. (In this context, set means a group or collection of elements.) If the modification does not alter var, then Solver does not call this member function.

If you want to use this facility, you must redefine this virtual member function.


beginBoolVarProcess

public virtual void beginBoolVarProcess(const IlcConstraint constraint)

Solver calls this member function when it begins to process a Boolean variable (that is, when the Boolean variable is in process). If the modification does not alter the Boolean variable, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


beginConstraintPost

public virtual void beginConstraintPost(const IlcConstraint constraint)

Solver calls this member function when it begins to post constraint.

If you want to use this facility, you must define this virtual member function.


beginConstraintPropagate

public virtual void beginConstraintPropagate(const IlcConstraint constraint)

Solver calls this member function when it begins to propagate the constraint constraint (that is, immediately before it calls the propagate member function for the constraint).

If you want to use this facility, you must define this virtual member function.


beginDemonProcess

public virtual void beginDemonProcess(const IlcDemon demon)

Solver calls this member function when it begins to process demon (that is, immediately before it propagates demon).

If you want to use this facility, you must define this virtual member function.


beginFloatVarProcess

public virtual void beginFloatVarProcess(const IlcFloatExp exp)

Solver calls this member function when it begins to process a floating-point expression (that is, when the floating-point expression is in process).

If you want to use this facility, you must define this virtual member function.


beginIntSetVarProcess

public virtual void beginIntSetVarProcess(const IlcIntSetVar var)

Solver calls this member function when it begins to process an integer set variable, that is, when the integer set variable is in process. In this context, set means a group or collection of elements.

If you want to use this facility, you must define this virtual member function.


beginIntVarProcess

public virtual void beginIntVarProcess(const IlcIntExp exp)

Solver calls this member function when it begins to process an integer expression (that is, when the integer expression is in process).

If you want to use this facility, you must define this virtual member function.


beginRemovePossible

public virtual void beginRemovePossible(const IlcIntSetVar var, IlcInt val)

Solver calls this member function immediately before it removes val from the set of possible elements of the integer set variable var. (In this context, set means a group or collection of elements.) In other words, var has not yet been modified when it is passed to this member function. Normally, if the modification does not alter var, then Solver does not call this member function. However, this modification necessarily modifies var.

If you want to use this facility, you must define this virtual member function.


beginRemoveValueFloatVar

public virtual void beginRemoveValueFloatVar(const IlcFloatExp, IlcFloat val)

Solver calls this member function immediately before it removes val from the domain of exp. In other words, exp has not yet been modified when it is passed to this member function. Normally, if the modification does not alter exp, then Solver does not call this member function. However, this modification necessarily modifies exp.

If you want to use this facility, you must define this virtual member function.


beginRemoveValueIntVar

public virtual void beginRemoveValueIntVar(const IlcIntExp exp, IlcInt val)

Solver calls this member function immediately before it removes val from the domain of exp. In other words, exp has not yet been modified when it is passed to this member function. Normally, if the modification does not alter exp, then Solver does not call this member function. However, this modification necessarily modifies exp.

If you want to use this facility, you must define this virtual member function.


beginSetMaxFloatVar

public virtual void beginSetMaxFloatVar(const IlcFloatExp exp, IlcFloat max)

Solver calls this member function immediately before it sets max as the maximum of exp. (In this context, set means to assign.) In other words, exp has not yet been modified when it is passed to this member function. Normally, if the modification does not alter exp, then Solver does not call this member function. However, this modification necessarily alters exp.

If you want to use this facility, you must define this virtual member function.


beginSetMaxIntVar

public virtual void beginSetMaxIntVar(const IlcIntExp exp, IlcInt max)

Solver calls this member function immediately before it sets max as the maximum of exp. (In this context, set means to assign.) In other words, exp has not yet been modified when it is passed to this member function. Normally, if the modification does not alter exp, then Solver does not call this member function. However, this modification necessarily alters exp.

If you want to use this facility, you must define this virtual member function.


beginSetMinFloatVar

public virtual void beginSetMinFloatVar(const IlcFloatExp exp, IlcFloat min)

Solver calls this member function immediately before it sets min as the minimum of exp. (In this context, set means to assign.) In other words, exp has not yet been modified when it is passed to this member function. Normally, if the modification does not alter exp, then Solver does not call this member function. However, this modification necessarily alters exp.

If you want to use this facility, you must define this virtual member function.


beginSetMinIntVar

public virtual void beginSetMinIntVar(const IlcIntExp exp, IlcInt min)

Solver calls this member function immediately before it sets min as the minimum of exp. (In this context, set means to assign.) In other words, exp has not yet been modified when it is passed to this member function. Normally, if the modification does not alter exp, then Solver does not call this member function. However, this modification necessarily alters exp.

If you want to use this facility, you must define this virtual member function.


beginSetValueFloatVar

public virtual void beginSetValueFloatVar(const IlcFloatExp, IlcFloat val)

Solver calls this member function immediately after it sets val as the value of exp (that is, after it instantiates exp). (In this context, set means to assign.) If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


beginSetValueIntVar

public virtual void beginSetValueIntVar(const IlcIntExp exp, IlcInt val)

Solver calls this member function when it sets val as the value of exp. (In this context, set means to assign.) That is, Solver calls this member function immediately before it instantiates exp. In other words, exp has not yet been modified when it is passed to this member function. Normally, if the modification does not alter exp, then Solver does not call this member function. However, instantiation necessarily modifies exp.

If you want to use this facility, you must define this virtual member function.


defineIlcOr

public virtual void defineIlcOr(IlcInt nbOr)

Solver calls this member function when it sets a choice point.

If you want to use this facility, you must define this virtual member function.


endAddRequired

public virtual void endAddRequired(const IlcIntSetVar var, IlcInt val)

Solver calls this member function immediately after it adds the element val to the set of required elements of the set variable var. (In this context, set means a group or collection of elements.) If the modification does not alter var, then Solver does not call this member function.

If you want to use this facility, you must redefine this virtual member function.


endBoolVarProcess

public virtual void endBoolVarProcess(const IlcConstraint constraint)

Solver calls this member function immediately after the Boolean variable indicated by constraint is processed.

If you want to use this facility, you must define this virtual member function


endConstraintPost

public virtual void endConstraintPost(const IlcConstraint constraint)

Solver calls this member function immediately after it calls the post member function for constraint (that is, while constraint is in process).

If you want to use this facility, you must define this virtual member function.


endConstraintPropagate

public virtual void endConstraintPropagate(const IlcConstraint constraint)

Solver calls this member function immediately after it calls the propagate member function for the constraint constraint (that is, while the constraint is in process).

If you want to use this facility, you must define this virtual member function.


endDemonProcess

public virtual void endDemonProcess(const IlcDemon demon)

Solver calls this member function immediately after it calls the propagate member function for demon (that is, while demon is in process).

If you want to use this facility, you must define this virtual member function.


endFloatVarProcess

public virtual void endFloatVarProcess(const IlcFloatExp exp)

Solver calls this member function immediately after exp is processed.

If you want to use this facility, you must define this virtual member function


endIntSetVarProcess

public virtual void endIntSetVarProcess(const IlcIntSetVar var)

Solver calls this member function immediately after the integer set variable var is processed. (In this context, set means a group or collection of elements.)

If you want to use this facility, you must define this virtual member function.


endIntVarProcess

public virtual void endIntVarProcess(const IlcIntExp exp)

Solver calls this member function immediately after exp is processed. If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


endRemovePossible

public virtual void endRemovePossible(const IlcIntSetVar var, IlcInt val)

Solver calls this member function immediately after it removes val from the set of possible elements of the integer set variable var. (In this context, set means a group or collection of elements.) If the modification does not alter var, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


endRemoveValueFloatVar

public virtual void endRemoveValueFloatVar(const IlcFloatExp exp, IlcFloat val)

Solver calls this member function immediately after it removes val from the domain of exp. If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


endRemoveValueIntVar

public virtual void endRemoveValueIntVar(const IlcIntExp exp, IlcInt val)

Solver calls this member function immediately after it removes val from the domain of exp. If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


endSetMaxFloatVar

public virtual void endSetMaxFloatVar(const IlcFloatExp exp, IlcFloat max)

Solver calls this member function immediately after it sets max as the maximum of exp. (In this context, set means to assign.) If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


endSetMaxIntVar

public virtual void endSetMaxIntVar(const IlcIntExp exp, IlcInt max)

Solver calls this member function immediately after it sets max as the maximum of exp. (In this context, set means to assign.) If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


endSetMinFloatVar

public virtual void endSetMinFloatVar(const IlcFloatExp exp, IlcFloat min)

Solver calls this member function immediately after it sets min as the minimum of exp. (In this context, set means to assign.) If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


endSetMinIntVar

public virtual void endSetMinIntVar(const IlcIntExp exp, IlcInt min)

Solver calls this member function immediately after it sets min as the minimum of exp. (In this context, set means to assign.) If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


endSetValueFloatVar

public virtual void endSetValueFloatVar(const IlcFloatExp exp, IlcFloat val)

Solver calls this member function immediately after it sets val as the value of exp (that is, after it instantiates exp). (In this context, set means to assign.) If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


endSetValueIntVar

public virtual void endSetValueIntVar(const IlcIntExp exp, IlcInt val)

Solver calls this member function immediately after it sets val as the value of exp (that is, after it instantiates exp). (In this context, set means to assign.) If the modification does not alter exp, then Solver does not call this member function.

If you want to use this facility, you must define this virtual member function.


failDemon

public virtual void failDemon(const IlcDemon demon)

Solver calls this member function when demon triggers a failure.

If you want to use this facility, you must define this virtual member function.


failFloatVar

public virtual void failFloatVar(const IlcFloatExp exp)

Solver calls this member function when the modification of exp triggers a failure.

If you want to use this facility, you must define this virtual member function.


failIntSetVar

public virtual void failIntSetVar(const IlcIntSetVar var)

Solver calls this member function when the modification of the integer set variable var triggers a failure. (In this context, set means a group or collection of elements.)

If you want to use this facility, you must define this virtual member function.


failIntVar

public virtual void failIntVar(const IlcIntExp exp)

Solver calls this member function when the modification of exp triggers a failure. You can access the demon or constraint where exp triggered the failure; to do so, use the member function IlcTraceI::getActiveDemon.

If you want to use this facility, you must define this virtual member function.


failManager

public virtual void failManager(IlcInt nbFails)

Solver calls this member function after it calls the member function IlcGoal::fail or IlcConstraint::fail (that is, when a failure occurs). You can access the current number of failures through the parameter nbFails.


getActiveDemon

public IlcDemon getActiveDemon()

This member function returns the demon that is currently active (if there is one). It will return an empty handle if there is no active demon.

Since a constraint is also a demon (that is, IlcConstraint derives from IlcDemon), you can also use this member function to access the currently active constraint. You may also access any constraint associated with an active demon in these ways:

 IlcDemon::getConstraint(); 

or

 getActiveDemon().getConstraint();

getStream

public ostream & getStream() const

This member function indicates which stream will be used for output of the trace.


isAllTraced

public IlcBool isAllTraced() const

This member function indicates whether all events are being traced.


isConstraintTraced

public IlcBool isConstraintTraced() const

This member function indicates whether calls to post and propagate constraints are being traced.


isDemonTraced

public IlcBool isDemonTraced() const

This member function indicates whether calls to propagate demons are being traced.


isFailTraced

public IlcBool isFailTraced() const

This member function indicates whether failures are being traced.


isNoneTraced

public IlcBool isNoneTraced() const

This member function indicates whether no events are being traced.


isProcessTraced

public IlcBool isProcessTraced() const

This member function indicates whether the variables in process are being traced.


isVarTraced

public IlcBool isVarTraced() const

This member function indicates whether all variables are being traced.


setTraceAllEvents

public void setTraceAllEvents()

This member function traces all events.


setTraceConstraint

public void setTraceConstraint(IlcBool condition)

If a constraint is pushed onto the propagation queue, then this member function traces it if condition is true. In general, this member function traces the posting and propagation of constraints.


setTraceDemons

public void setTraceDemons(IlcBool condition)

This member function traces all calls to all demons, including constraints, if condition is true. (A constraint is also a demon.)


setTraceFail

public void setTraceFail(IlcBool condition)

This member function traces failures if condition is true. (For users of previous versions of Solver, this member function replaces setFailHook.)


setTraceNoEvent

public void setTraceNoEvent()

This member function traces no events. That is, it turns off event tracing.


setTraceProcess

public void setTraceProcess(IlcBool condition)

This member function traces all the variables that are in process if condition is true.


setTraceVars

public void setTraceVars(IlcBool condition)

This member function traces the modifications of variables if condition is true.


trace

public void trace(IlcAnySetVar) const

This member function hooks a variable; that is, it offers a link between a trace and a variable. (For users of previous versions of Solver, this member function resembles the trace hook mechanism.)


trace

public void trace(IlcIntSetVar) const

This member function hooks a variable; that is, it offers a link between a trace and a variable. (For users of previous versions of Solver, this member function resembles the trace hook mechanism.)


trace

public void trace(IlcFloatVar) const

This member function hooks a variable; that is, it offers a link between a trace and a variable. (For users of previous versions of Solver, this member function resembles the trace hook mechanism.)


trace

public void trace(IlcAnyVar) const

This member function hooks a variable; that is, it offers a link between a trace and a variable. (For users of previous versions of Solver, this member function resembles the trace hook mechanism.)


trace

public void trace(IlcIntVar) const

This member function hooks a variable; that is, it offers a link between a trace and a variable. (For users of previous versions of Solver, this member function resembles the trace hook mechanism.)