FRAMES NO FRAMES

Class IlcSearchLimitI

Definition file: ilsolver/search.h
Include file: <ilsolver/ilosolver.h>

A search limit is an object in Solver. Like other Solver entities, a search limit is implemented by means of two classes: a handle class and an implementation class. In other words, an instance of the class IlcSearchLimit (a handle) contains a data member (the handle pointer) that points to an instance of the class IlcSearchLimitI (its implementation object).

A search limit is used to prune part of the search tree. The member function check indicates whether the limit has been reached.

A search limit has its own life cycle:

The class IlcSearchLimitI is extendable; in other words, you can write your own search limits. For an example of how to do so, see the IBM ILOG Solver User's Manual.

See Also:

Constructor and Destructor Summary
public IlcSearchLimitI(IloSolver solver, IlcBool duplicate)
public ~IlcSearchLimitI()
Method Summary
public virtual IlcBoolcheck(const IlcSearchNode node) const
public virtual IlcSearchLimitI *duplicateLimit(IloSolver solver)
public virtual voidinit(const IlcSearchNode node)
Constructor and Destructor Detail

IlcSearchLimitI

public IlcSearchLimitI(IloSolver solver, IlcBool duplicate)

This constructor creates an instance of the class IlcSearchLimitI using solver. The parameter duplicate indicates if the object is an internal copy used by the solver (duplicate = IlcTrue), or if it is just a template. This constructor should not be called directly as this class is an abstract class. This constructor is called automatically in the constructor of its subclasses.


~IlcSearchLimitI

public ~IlcSearchLimitI()

This destructor is called automatically by the destructor of its subclasses. It frees memory used by the objects.


Method Detail

check

public virtual IlcBool check(const IlcSearchNode node) const

This member function is called with the current node as parameter to check whether the limit implemented by the object has been reached. If the limit has been reached, this virtual member function should return IlcTrue. Afterwards, the unexplored search tree covered by this limit will be simply discarded.

When you implement this virtual member function yourself, you should make sure that your implementation decides exactly one time (that is, once and for all) whether a limit has been reached. Once the limit has been reached, it will not be called again, and all nodes covered by the limit will be discarded. The signature includes const for that reason to avoid accumulated effects of multiple calls of this member function.


duplicateLimit

public virtual IlcSearchLimitI * duplicateLimit(IloSolver solver)

This member function is called internally to duplicate the current search limit. When you use this function, the duplicate parameter in the IlcSearchLimitI constructor should be equal to IlcTrue.


init

public virtual void init(const IlcSearchNode node)

When the goal IlcLimitSearch executes, it calls this method with the current node passed as its parameter. The purpose of this method is to store a reference state for the node evaluator.