Skip to main content
FRAMES NO FRAMES

Class IlcSearchLimitI

Definition file: ilcp/cpext.h
Include file: <ilcp/cpext.h>
Map of IlcSearchLimitIIlcSearchLimitIIlcSearchLimitI
The implementation class for a search limit.

A search limit is an object in CP Optimizer. Like other CP Optimizer 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.

See Also:

Method Summary
public virtual IlcBoolcheck() const
public IlcSearchLimitI(IlcCPEngine cp)
public virtual voidinit()
public ~IlcSearchLimitI()
Method Detail

IlcSearchLimitI

public IlcSearchLimitI(IlcCPEngine cp)

This constructor creates an instance of the class IlcSearchLimitI using cp. This constructor should not be called directly as this class is an abstract class. This constructor is to be called 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.


check

public virtual IlcBool check() const

This member function is called 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. Afterward, 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.


init

public virtual void init()

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.