Download IBM ILOG CP Optimizer User`s Manaul

Transcript
Terse level trace
In terse level, the trace displays messages about processing at the root of the first kind of
constraints (marked P in the trace). It also displays a message at each failure. These messages
about constraint processing at the root and about failure are useful in debugging a faulty
model.
For example, if your model is not behaving as expected, you can turn on the trace in terse
mode and look for the source of the unexpected behavior.
As an example of this debugging technique, first consider the sample facility.cpp available
in the distribution of IBM® ILOG® CP Optimizer. The sample has been modified slightly to
include a dummy constraint that will surely trigger failure:
model.add(open[3] == 2); // this constraint will trigger an immediate failure
Also, this line has been added to turn on the trace at terse level:
cp.setParameter(IloCP::PropagationLog, IloCP::Terse);
When you compile, link and run the modified sample, the following trace is produced:
!
-!
!
!
-------------------------------------------------------------------------Minimization problem - 13 variables, 14 constraints
SearchType
= DepthFirst
PropagationLog
= Terse
% Begin initial propagation
! Problem found infeasible at the root node
% P [IloIntVar(27)[0..1] == 2 ]
!
-!
!
!
!
Failure (1)
-------------------------------------------------------------------------Solution status
Number of branches
Number of fails
Total memory usage
: Terminated normally, model has no solution
: 0
: 1
: 367.0 Kb (347.8 Kb CP Optimizer + 19.2 Kb Concert)
! Time spent in solve
: 0.00s (0.00s engine + 0.00s extraction)
! Search speed (br. / s) : 0
! ---------------------------------------------------------------------------
As you can see in that terse trace, the constraint that triggers failure is reported immediately
before the failure is reported.
U S E R ' S
M A N U A L
215