• No results found

Visualizing Propagation

ILOG Solver Debugger provides you with three tools that allow you to display the propagation in the GUI:

the Propagation Spy to trace events, described in Using the Propagation Spy

the Variable Domains notebook pages in the Output window, described in Visualizing Variable Domains

the Activity Domains window for Scheduler applications, described in Visualizing Activity Domains (Scheduler-Specific)

Events

Events can take place:

◆ during the Initial Propagation

◆ during the Initial Goal before the first OR

◆ inside a Search Tree node

Events can be triggered as a direct consequence of:

◆ a constraint propagation triggered by a demon becoming active

◆ a constraint propagation coming from a pushed constraint

◆ a decision taken during the search

◆ an optimization event coming from the minimization or maximization of an objective function

Using the Propagation Spy

The Propagation Spy is a means of displaying the trace of events and the result of the propagation in terms of domain reduction. The Propagation Spy provides a graphical representation of events trapped by the IlcTrace and IlcSchedulerTrace mechanisms.

See ILOG Solver and ILOG Scheduler documentation for details on these two classes.

The Propagation Spy is a special hierarchical sheet containing a tree hierarchy in the first column. Each column contains the impact on one variable. Time is represented vertically, from top to bottom. The textual description of the events is displayed in the first column.

When double-clicking on an event line, the columns are rearranged so that a variable of interest is displayed first.

The figure below shows what the tracing of the Initial Propagation for the Pheasants and Rabbits problem (debugpheasant) looks like in the Propagation Spy.

The cell at the junction of an event line and a variable column is colored according to the type of event and shows the result of the event in a textual form. You can follow the history of the domain reduction in that cell.

The correspondences between cell colors and the event types are:

◆ Red = fail

◆ Yellow = inProcess

◆ Blue = setValue

Tracing the Initial Propagation

To trace the Initial Propagation of your application, proceed as follows:

1. Select “Stop At Initial Propagation” from the Debug menu. With this option, the execution will be interrupted at the beginning of the Initial Propagation.

2. Click on the Run button.

3. The Initial Propagation is now displayed in the Propagation Spy window. The following options are available:

To enter the propagation detail, click on the Step In button.

- Trace all the Initial Propagation events without stopping at each event by clicking on the Continue Trace Till Next Node button.

- Trace the Initial Propagation and stop at each event by clicking on the Step In button.

- Leave the propagation detail at that point by clicking on the Step Out button.

To skip the Initial Propagation, click on the Step Over button.

4. The Debugger stops at the first search node (the first child of the root). The following options are available:

To visualize the decisions and the propagation events triggered within the first search node in the Propagation Spy, click on the Step In button.

To go to the beginning of the next node, click on the Step Over button.

To continue and interrupt the execution when you decide to, click on the Continue Run button and then on the Break button.

To abort the execution, click on the Abort button.

Tracing the Propagation at a Specific Node

Because of the nondeterministic nature of the search, it is not possible to draw the tree in advance. A second run is necessary to focus on a segment of the tree.

You can access statistical information about the Initial Propagation through the Search Tree root.

Tracing the Propagation at a Specific Node in the Search Tree To trace the propagation at a specific node, proceed as follows:

1. Run the Debugger a first time. Skip the Initial Propagation. Wait until the end of the solving or Abort if the solving process takes a long time.

2. Add a breakpoint on a specific node by right-clicking on the node (you can also include conditional breakpoints in your code).

3. Run the execution a second time. The tree nodes become white and are progressively re-colored.

4. Step into the node to display the propagation events.

Adding Breakpoints in Your Code

You can register conditional breakpoints in your code so that as soon as a condition becomes true, the execution is interrupted. You can use three types of conditional breakpoints:

◆ Interrupt the execution as soon as the minimum of a variable domain is greater than or equal to a value.

◆ Interrupt the execution as soon as the maximum of a variable domain is lower than or equal to a value.

◆ Interrupt the execution as soon as a variable is bound to a specific value.

For example, in the debugjobshopm example, uncomment the following line:

debugger.breakIfDomainMaxLe(_makespan),60);

The execution will be interrupted when the maximum of the makespan domain is lower than or equal to the value 60.

Conditional breakpoints are extracted by the initialize member function. So make sure you set the conditional breakpoints before the call to the member function

IlcSolverDebugger::initialize().

You can also call the member function IlcSolverDebugger::breakExecution() in your own goals.

Visualizing Variable Domains

You can set visualization options to follow the domains of the variables during the execution in the Output window located at the bottom of the Solver Debugger GUI.

Setting Visualization Options

To follow the domains of the variables, you can put graphical demons on your variables by passing a fourth argument to the member function registerVariable().

◆ To visualize the domain of an integer variable or an array of integer variables, use IlcVisualizeDomain.

◆ To visualize the lower and upper bounds of a variable or an array of variables, use IlcVisualizeInterval.

◆ To visualize the value of a variable or an array of variables, use IlcVisualizeValue.

◆ To display colored squares for Boolean variables (integer variables containing 0 in their domain), use IlcVisualizeBoolean.

◆ To disable visualization, use IlcVisualizeDisabled.Visualization is disabled by default.

These displays are available as notebook pages in the Output window of the Solver Debugger GUI.

Visualizing Variable Domains in the Output Window

The following variable visualization examples are taken from the debugnqueen problem.

◆ To visualize the domains of an array of integer variables, click on the corresponding tab in the Output window. In this example, because of the presolve that occurs when a model is extracted, the x1[0] variable replaces the expected queens[0].

Note: You may miss some changes if a failure occurs at a node before the graphical demon is executed.

◆ To visualize the bounds of an array of integer variables, click on the corresponding tab in the Output window.

◆ To visualize the values of an array of integer variables, click on the corresponding tab in the Output window.

◆ To visualize the state of an array of integer variables interpreted as Boolean, click on the corresponding tab in the Output window. In this example, the colors have the following meaning: wheat stands for false, blue stands for true, and grey stands for undetermined.

Visualizing Activity Domains (Scheduler-Specific)

Activity Domains are specific to the product ILOG Scheduler.

The Activity Domains dockable window shows the algorithm reducing the domains of the activities during the propagation.

Mode Selectors

The following figures represent the evolution of Activity Domains throughout the propagation.

Because of the breakable nature of some of the activities, the Start Min- End Min blue rectangle and the Start Max-End Max red rectangle may not always be the same size.

As soon as end min passes start max, the time window between these two dates is the surely overlapped time window.

The activity is totally instantiated. When start min = start max and end min = end max, the activity schedule is totally determined.

The order in which the activities appear in the Activity Domains window is the same as the

Related documents