FRAMES NO FRAMES

Class IlcNodeEvaluatorI

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

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

A node evaluator is linked to the life cycle of an open node. When a node is created, the method evaluate is called to evaluate the node. When the solver has to decide if it should jump to another node, the method subsume is called.

A node evaluator has its own life cycle:

See Also:

Constructor and Destructor Summary
public IlcNodeEvaluatorI(IloSolver solver, IlcBool duplicate)
public ~IlcNodeEvaluatorI()
Method Summary
public virtual IlcNodeEvaluatorI *duplicateEvaluator(IloSolver solver)
public virtual IlcFloatevaluate(const IlcSearchNode n) const
public virtual voidinit(const IlcSearchNode node)
public virtual IlcBoolsubsume(IlcFloat evalBest, IlcFloat evalCurrent) const
Constructor and Destructor Detail

IlcNodeEvaluatorI

public IlcNodeEvaluatorI(IloSolver solver, IlcBool duplicate)

This constructor creates an instance of the class IlcNodeEvaluatorI using solver. The parameter duplicate indicates whether the object is an internal copy used by the solver (duplicate = IlcTrue), or whether 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.


~IlcNodeEvaluatorI

public ~IlcNodeEvaluatorI()

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


Method Detail

duplicateEvaluator

public virtual IlcNodeEvaluatorI * duplicateEvaluator(IloSolver solver)

This member function is called internally to duplicate the current node evaluator. When you use this member function, the duplicate parameter in the IlcNodeEvaluatorI constructor should be equal to IlcTrue.


evaluate

public virtual IlcFloat evaluate(const IlcSearchNode n) const

When an open node n is created, this member function is called to evaluate the node. It returns a floating-point value which is the evaluation of the node. An evaluation of IlcInfinity means that the node should be discarded.

When you implement your own version of this virtual member function, you should make sure that your implementation is independent of the state of the solver (the instance of IloSolver where the invoking node evaluator is working). This signature includes const for that reason to prevent accumulated effects of multiple calls to this member function.


init

public virtual void init(const IlcSearchNode node)

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


subsume

public virtual IlcBool subsume(IlcFloat evalBest, IlcFloat evalCurrent) const

During the search, the solver must decide if it should postpone the evaluation of the current node and move to another open node. This decision is based on the result of the subsume method. The subsume method is called with two floating-point values as parameters. The first value corresponds to the evaluation of the best open node, the second to the evaluation of the current node. This method returns IlcTrue to indicate that the solver should postpone the evaluation of the current node and continue with the evaluation of the best open node.

When you implement your own version of this member function, you should make sure that your implementation is independent of the state of the solver (the instance of IloSolver where the invoking node evaluator is working). Your implementation of subsume should decide statically whether one node subsumes another. This signature includes const for that reason to prevent accumulated effects of multiple calls to this member function.