IBM ILOG Solver Debugger User's Manual > IlcSolverDebugger

Category

C++ class

Description

The class IlcSolverDebugger provides an interface to the IBM® ILOG® Solver Debugger in an IBM ILOG Solver environment.

Include File

<ilsolver/solverdebugger.h>

Synopsis

class class IlcSolverDebugger: public IlcDebugger { 
public:
    IlcSolverDebugger(IloSolver solver, 
                      IloBool active = IloTrue, 
                      IloBool textual = IloFalse, 
                      double pollingPeriod = 1.0, 
                      int socketPort = 4011, 
                      const char* guiServer = 0, 
                      IloBool nestedSearch = IloFalse);
    void breakIfBound(IloFloatVar var, IloNum val);
    void breakIfBound(IloIntVar var, IloInt val); 
    void breakIfDomainMaxLe(IloFloatVar var, IloNum val);
    void breakIfDomainMaxLe(IloIntVar var, IloInt val);
    void breakIfDomainMinGe(IloFloatVar var, IloNum val); 
    void breakIfDomainMinGe(IloIntVar var, IloInt val);
    void displayProfiling();
    IloSolver getSolver() const;
    IloBool initialize();
    void profileAllConstraints(IloBool all);
    void registerConstraint(IloConstraint cst, 
                            IloBool browse = IloTrue, 
                            IloBool trace = IloTrue); 
    void registerVariable(IloFloatVar var, 
              IloBool browse = IloTrue,
              IloBool trace = IloTrue,
               IlcVisualizeOption option = IlcVisualizeDisabled);
    void registerVariable(IloFloatVarArray var, 
               IloBool browse = IloTrue, 
               IloBool trace = IloTrue,
                IlcVisualizeOption option = IlcVisualizeDisabled,
                const char* name = 0); 
    void registerVariable(IloIntVar var, 
              IloBool browse = IloTrue, 
              IloBool trace = IloTrue,
               IlcVisualizeOption option = IlcVisualizeDisabled); 
    void registerVariable(IloIntVarArray var, 
               IloBool browse = IloTrue, 
               IloBool trace = IloTrue,
               IlcVisualizeOption option = IlcVisualizeDisabled,
               const char* name = 0); 
   }; 

Constructor

IlcSolverDebugger(IloSolver solver,

IloBool active = IloTrue,

IloBool textual = IloFalse,

double pollingPeriod = 1.0,

int socketPort = 4011,

const char* guiServer = 0,

IloBool nestedSearch = IloFalse);

When the active parameter is true, the Debugger is active and tries to connect to the GUI immediately. Otherwise, the Debugger library has no effect. In this case, the member function initialize() returns true when it is called for the first time and false otherwise. The sendConsole() and sendSolution() member functions display the messages on the standard output. The parameter solver indicates the IloSolver object to which the constraints are added. With the parameter textual, if the Debugger is active, XML messages are sent to the standard output (stdout) instead of the GUI. The parameter pollingPeriod sets the number of seconds between two abort or break checks. The parameter socketPort indicates the port number for which the GUI is waiting. The parameter guiServer indicates the machine name on which the GUI is running. If this parameter is null, then localhost is taken.

Member Functions

void breakIfBound(IloFloatVar var, IloNum val);

Registers a conditional breakpoint. The execution is interrupted at this conditional breakpoint if the specified floating point variable is bound to val.

void breakIfBound(IloIntVar var, IloInt val);

Registers a conditional breakpoint. The execution is interrupted at this conditional breakpoint if the specified integer variable is bound to val.

void breakIfDomainMaxLe(IloFloatVar var, IloNum val);

Registers a conditional breakpoint. The execution is interrupted at this conditional breakpoint if the domain max of the specified floating point variable is lower than or equal to val.

void breakIfDomainMaxLe(IloIntVar var, IloInt val);

Registers a conditional breakpoint. The execution is interrupted at this conditional breakpoint if the domain max of the specified integer variable is lower than or equal to val.

void breakIfDomainMinGe(IloFloatVar var, IloNum val);

Registers a conditional breakpoint. The execution is interrupted at this conditional breakpoint if the domain min of the specified floating point variable is greater than or equal to val.

void breakIfDomainMinGe(IloIntVar var, IloInt val);

Registers a conditional breakpoint. The execution is interrupted at this conditional breakpoint if the domain min of the specified integer variable is greater than or equal to val.

void displayProfiling();

Creates and displays the Constraint Profiler window from code. (Equivalent to clicking on the Constraint Profiler button from the GUI).

IloSolver getSolver() const;

Returns the same IloSolver instance as the one passed to the constructor.

IloBool initialize();

Initializes a running session. Returns false if a Quit order comes from the GUI.

void profileAllConstraints(IloBool all);

By default all constraints are profiled. To restrict the list of monitored constraints, use profileAllConstraints(IloFalse) and call the registerConstraint method on the constraints your are interested in.

void registerConstraint(IloConstraint cst,

IloBool browse = IloTrue,

IloBool trace = IloTrue);

Registers an interest in the constraint cst. The parameter cst indicates the constraint to consider. If the parameter browse is true, the model should be displayed in the Debugger Model Browser. If the parameter trace is true, the variables must be traced.

void registerVariable(IloFloatVar var,

IloBool browse = IloTrue,

IloBool trace = IloTrue,

IlcVisualizeOption option = IlcVisualizeDisabled);

Registers an interest in the float variable var. The parameter var indicates the variable to consider. If the parameter browse is true, the model should be displayed in the Debugger Model Browser. If the parameter trace is true, the variables must be traced. The parameter option gives access to a graphical monitoring of the variable (displaying its range or value).

void registerVariable(IloFloatVarArray var,

IloBool browse = IloTrue,

IloBool trace =IloTrue,

IlcVisualizeOption option = IlcVisualizeDisabled,

const char* name = 0);

Registers an interest in the array of float variables var. The parameter var indicates the array of variables to consider. If the parameter browse is true, the model should be displayed in the Debugger Model Browser. If the parameter trace is true, the variables must be traced. The parameter option gives access to a graphical monitoring of the variable (displaying its range or value).

void registerVariable(IloIntVar var,

IloBool trace =IloTrue,

IloBool browse = IloTrue,

IlcVisualizeOption option = IlcVisualizeDisabled);

Registers an interest in the integer variable var. The parameter var indicates the Ilovar to consider. If the parameter browse is true, then if the model is browsed it will be displayed in the Debugger Model Browser. If the parameter trace is true, variables must be traced and taken into account in the Christmas Tree. The parameter option gives access to a graphical monitoring of the variable (displaying its range or value).

void registerVariable(IloIntVarArray var,

IloBool browse = IloTrue,

IloBool trace = IloTrue,

IlcVisualizeOption option = IlcVisualizeDisabled,

const char* name = 0);

Registers an interest in the array of integer variables var. The parameter var indicates the array of variables to consider. If the parameter browse is true, the model should be displayed in the Debugger Model Browser. If the parameter trace is true, the variables must be traced and taken into account in the Christmas Tree. The parameter option gives access to a graphical monitoring of the variable (displaying its domain, range, and value).