Overview | Group | Tree | Graph | Index | Concepts |
The class IlcSchedulerTraceI
is the base class used to build
a trace for a scheduling problem. It provides virtual methods that are
called when a change occurs on a traced scheduling object, and is intended
to be sub-classed by the user so that its behavior fits the user's
needs.
The default behavior of all the virtual methods is to do nothing, so that one can overload only the methods one is interested in.
Tracing modifications of objects
When a modification on a traced scheduling object (see IlcSchedulerTrace
) occurs, the virtual method that
corresponds to this change (named xxxChange
, where
xxx
is the type of object that changes) will be called twice:
first just before the modification, then just after. The timing of a
particular call (whether just before or just after the modification) is
indicated by the first argument, a boolean value that equals
IlcTrue
if that call occurred just before the modification.
The other arguments give the context of the modification: the instance of object that is being modified, the type of change, and the value that is used to change the object (for example, the new minimum value or the value removed from the possible set).
Tracing failures
When a failure occurs, it will be traced if either of the two following conditions hold:
IlcSchedulerTrace::traceAllFailures
was
called.If a failure is traced, then one or more virtual methods of the class
IlcSchedulerTraceI
will be called.
failIntVar
or
failIntSetVar
will be called, depending on the type of variable.
fail()
, then
failDemon
will be called.
failManager
will be called.Example
class MyTraceI : public IlcSchedulerTraceI { public: MyTraceI(IlcScheduleI* schedule, const char* name=0); virtual ~MyTraceI() {} ... }; int main () { ... MyTraceI* myTraceI = new (solver.getGlobalHeap()) MyTraceI(scheduler, "MyTrace")); IlcSchedulerTrace myTrace(myTraceI); ... }
See Also:
IlcSchedulerPrintTrace, IlcSchedulerTrace
Constructor and Destructor Summary | |
---|---|
public | IlcSchedulerTraceI(IlcScheduleI * schedule, const char * name=0) |
Method Summary | |
---|---|
public virtual void | activityChange(IlcBool isBeginEvent, const IlcActivity act, IlcSchedulerChange change, IlcSolverChange solverChange, const IlcActivity act2, IlcInt val) |
public virtual void | altResConstraintChange(IlcBool isBeginEvent, const IlcAltResConstraint altResCt, IlcSchedulerChange change, IlcSolverChange solverChange, IlcInt intVal) |
public virtual void | anyTimetableChange(IlcBool isBeginEvent, const IlcAnyTimetable tt, IlcSchedulerChange change, IlcInt t1, IlcInt t2, IlcAnySet anySet, IlcAny anyVal) |
public virtual void | failDemon(const IlcDemon demon) |
public virtual void | failIntSetVar(const IlcIntSetVar setVar) |
public virtual void | failIntVar(const IlcIntExp exp) |
public virtual void | failManager(IlcInt nbFails) |
public IlcActivity | getCurrentActivity1() const |
public IlcActivity | getCurrentActivity2() const |
public IlcAltResConstraint | getCurrentAltResConstraint() const |
public IlcAltResSet | getCurrentAltResSet() const |
public IlcPrecedenceConstraint | getCurrentPrecedenceConstraint() const |
public IlcResource | getCurrentResource() const |
public IlcResourceConstraint | getCurrentResourceConstraint1() const |
public IlcResourceConstraint | getCurrentResourceConstraint2() const |
public IlcTimeBoundConstraint | getCurrentTimeBoundConstraint() const |
public IlcInt | getCurrentTimeMax() const |
public IlcInt | getCurrentTimeMin() const |
public IlcFailReason | getFailReason() const |
public const char * | getMessage(IlcFailReason reason) const |
public const char * | getMessage(IlcSolverChange chg) const |
public const char * | getMessage(IlcSchedulerChange chg) const |
public IlcScheduleI * | getScheduleI() const |
public IloSolver | getSolver() const |
public | ILCSTD(ostream) const |
public virtual void | intTimetableChange(IlcBool isBeginEvent, const IlcIntTimetable tt, IlcSchedulerChange change, IlcInt t1, IlcInt t2, IlcInt intVal) |
public virtual void | precedenceConstraintChange(IlcBool isBeginEvent, const IlcPrecedenceConstraint precCt, IlcSchedulerChange change, IlcSolverChange solverChange, IlcInt intVal) |
public virtual void | resourceConstraintChange(IlcBool isBeginEvent, const IlcResourceConstraint resCt, IlcSchedulerChange change, IlcSolverChange solverChange, const IlcResourceConstraint resCt2, IlcInt intVal, IlcAny anyVal) |
public virtual void | timeBoundConstraintChange(IlcBool isBeginEvent, const IlcTimeBoundConstraint tbCt, IlcSchedulerChange change, IlcSolverChange solverChange, IlcInt intVal) |
Constructor and Destructor Detail |
---|
This constructor creates a new instance of
IlcSchedulerTraceI
and adds it to the given
schedule
. It can be used to trace all objects in
schedule
. Its name is set to name
.
Method Detail |
---|
This member function is called when a change occurs on the traced
activity act
. If activityChange
is called just
before the modification, then isBeginEvent
equals
IlcTrue;
it equals IlcFalse
if the modification
has just occurred. The argument change
indicates what is
changed in the activity (for example, the start
variable or
end
variable). If the change is related to an underlying Solver
object (such as the start
variable), then
solverChange
indicates how this object is changed (for example,
setMin
, setMax
, setValue
). Otherwise,
this parameter equals IlcUndefinedSolverChange
.
Some events (such as IlcActivitySetSuccessor
) are related to
two activities. In this case, act2
is a handle on this other
activity. Otherwise, it is an empty handle.
When an integer Solver variable is changed, the value used (such as the
new minimum) is given in val
. When an activity is postponed
(either forward or backward), the date from which it is postponed is given
in val
. Otherwise, the value of this argument is
IlcIntMin
.
This member function is called when a change occurs on the traced
alternative resource constraint altResCt
. If
altResConstraintChange
is called just before the modification,
then isBeginEvent
equals IlcTrue;
it equals
IlcFalse
if the modification has just occurred. The argument
change
indicates what is changed in the alternative resource
constraint (for example, the index
variable). If the change is
related to an underlying Solver object (such as the index
variable), then solverChange
indicates how this object is
changed (for example, setMin
, setMax
,
setValue
). Otherwise, this parameter equals
IlcUndefinedSolverChange
.
Some events (such as IlcResourceConstraintSetSuccessor
) are
related to two alternative resource constraints. In this case,
resCt2
is a handle on this other alternative resource
constraint. Otherwise, it is an empty handle.
When an integer Solver variable is changed, the value used (such as the
new minimum) is given in intVal
. Otherwise, the value of this
argument is IlcIntMin
.
This member function is called when a change occurs on the traced
timetable tt
. If resourceConstraintChange
is
called just before the modification, then isBeginEvent
equals
IlcTrue;
it equals IlcFalse
if the modification
has just occurred. The argument change
indicates what is
changed in the timetable.
The parameters t1
and t2
define the interval on
which the timetable is being modified.
The value used to change the timetable (for example, the set of states
removed from the possible states set) is given in anySet
. If
the value consists of only one IlcAny
, then anySet
is an empty handle, and this value is given in anyVal
. The
value used to change the timetable (such as the value removed from the
possible states set) is given in anyVal
, if it is only a single
state. Otherwise, this parameter equals 0 and the values are given in
anySet
.
This method is called when demon
triggers a failure.
This method is called when a modification of setVar
triggers
a failure.
This method is called when a modification of exp
triggers a
failure.
This method is called when a failure occurs. The new number of fails is nbFails
.
When a fail occurs and the activity related to the failure is known to
Scheduler Engine, then this method returns this activity. Otherwise it
returns an empty handle. This method must only be called when inside a call
to failDemon
, failIntVar
,
failIntSetVar
or failManager
.
When a fail occurs and a second activity related to the failure is known
to the Scheduler Engine (e.g. one activity is said to be next to another,
and this leads to a fail), then this method returns this second activity.
Otherwise it returns an empty handle. This method must only be called when
inside a call to failDemon
, failIntVar
,
failIntSetVar
or failManager
.
When a fail occurs and an instance of IlcAltResConstraint
is known to the Scheduler Engine, then
this method returns this alternative resource constraint. Otherwise it
returns an empty handle. This method must only be called when inside a call
to failDemon
, failIntVar
,
failIntSetVar
or failManager
.
When a fail occurs and an instance of IlcAltResSet
related
to the failure is known to the Scheduler Engine, then this method returns
this alternative resource set. Otherwise it returns an empty handle. This
method must only be called when inside a call to failDemon
,
failIntVar
, failIntSetVar
or
failManager
.
When a fail occurs and a precedence constraint related to the failure is
known to the Scheduler Engine, then this method returns this precedence
constraint. Otherwise it returns an empty handle. This method must only be
called when inside a call to failDemon
,
failIntVar
, failIntSetVar
or
failManager
.
When a fail occurs and a resource related to the failure is known to the
Scheduler Engine, then this method returns this resource. Otherwise it
returns an empty handle. This method must only be called when inside a call
to failDemon
, failIntVar
,
failIntSetVar
or failManager
.
When a fail occurs and a resource constraint related to the failure is
known to the Scheduler Engine, then this method returns this resource
constraint. Otherwise it returns an empty handle. This method must only be
called when inside a call to failDemon
,
failIntVar
, failIntSetVar
or
failManager
.
When a fail occurs and a second resource constraint related to the
failure is known to the Scheduler Engine, then this method returns this
second resource constraint. Otherwise it returns an empty handle. This
method must only be called when inside a call to failDemon
,
failIntVar
, failIntSetVar
or
failManager
.
When a fail occurs and a time bound constraint related to the failure is
known to the Scheduler Engine, then this method returns this time bound
constraint. Otherwise it returns an empty handle. This method must only be
called when inside a call to failDemon
,
failIntVar
, failIntSetVar
or
failManager
.
When a fail occurs and the time interval related to the failure is known
to the Scheduler Engine, then this method returns the upper bound of this
interval. Otherwise it returns IlcIntMax
. This method must only
be called when inside a call to failDemon
,
failIntVar
, failIntSetVar
or
failManager
.
When a fail occurs and the time interval related to the failure is known
to the Scheduler Engine, then this method returns the lower bound of this
interval. Otherwise it returns IlcIntMin
. This method must only
be called when inside a call to failDemon
,
failIntVar
, failIntSetVar
or
failManager
.
When a fail occurs and the reason for the fail is known to the Scheduler
Engine, then this method returns the reason. If the reason of the fail is
unknown to the Scheduler Engine, this method will return
IlcFailReasonUnknown
. This method must only be called when
inside a call to failDemon
, failIntVar
,
failIntSetVar
or failManager
.
This member function returns a string containing the name of the change given as argument.
This member function returns the instance of IlcScheduleI
on
which the trace was built.
This member function returns the instance of IloSolver
that
is associated with the instance of IlcSchedule
on which the
trace was built.
This member function returns the stream that can be used to output trace information. This is the stream that is attached to the solver.
This member function is called when a change occurs on the traced integer
timetable tt
. If timeBoundConstraintChange
is
called just before the modification, then isBeginEvent
equals
IlcTrue;
it equals IlcFalse
if the modification
has just occurred. The argument change
indicates what is
changed in the timetable.
The value used to change the timetable (such as the new minimum) is given
by intVal
. The parameters t1
and t2
define the interval on which the timetable is being modified.
This member function is called when a change occurs on the traced
precedence constraint precCt
. If
precedenceConstraintChange
is called just before the
modification, then isBeginEvent
equals IlcTrue;
it
equals IlcFalse
if the modification has just occurred. The
argument change
indicates what is changed in the precedence
constraint (for example, the delay
variable). If the change is
related to an underlying Solver object (such as the delay
variable), then solverChange
indicates how this object is
changed (for example, setMin
, setMax
,
setValue
). Otherwise, this parameter equals
IlcUndefinedSolverChange
.
When an integer Solver variable is changed, the value used (such as the
new minimum) is given in intVal
. Otherwise, the value of this
argument is IlcIntMin
.
This member function is called when a change occurs on the traced
resource constraint resCt
. If
resourceConstraintChange
is called just before the
modification, then isBeginEvent
equals IlcTrue;
it
equals IlcFalse
if the modification has just occurred. The
argument change
indicates what is changed in the resource
constraint (for example, the capacity
variable). If the change
is related to an underlying Solver object (such as the capacity
variable), then solverChange
indicates how this object is
changed (for example, setMin
, setMax
,
setValue
). Otherwise, this parameter equals
IlcUndefinedSolverChange
.
Some events (such as IlcResourceConstraintSetSuccessor
) are
related to two resource constraints. In this case, resCt2
is a
handle on this other resource constraint. Otherwise, it is an empty
handle.
When an integer Solver variable is changed, the value used (for example,
the new minimum) is given in intVal
. Otherwise, this parameter
equals IlcIntMin
. When an IlcAnyVar
is changed
(such as the state
required), the value used (such as the
state
removed) is given in anyVal
. Otherwise this
parameter equals 0.
This member function is called when a change occurs on the traced time
bound constraint tbCt
. If
timeBoundConstraintChange
is called just before the
modification, then isBeginEvent
equals IlcTrue;
it
equals IlcFalse
if the modification has just occurred. The
argument change
indicates what is changed in the time bound
constraint (for example, the date
variable). If the change is
related to an underlying Solver object (such as the date
variable), then solverChange
indicates how this object is
changed (for example, setMin
, setMax
,
setValue
). Otherwise, this parameter equals
IlcUndefinedSolverChange
.
When an integer Solver variable is changed, the value used (for example,
the new minimum) is given in intVal
. Otherwise, this parameter
equals IlcIntMin
.