Skip to main content
FRAMES NO FRAMES

Class IlcIntSelectEvalI

Definition file: ilcp/cpext.h
Include file: <ilcp/cpext.h>
Map of IlcIntSelectEvalIIlcIntSelectEvalIIlcIntSelectEvalIIlcIntSelectI
An implementation class for a value selector.

CP Optimizer lets you control the order in which the values in the domain of a constrained variable are tried during the search for a solution.

This class is an implementation class. It is the predefined subclass of IlcIntSelectI that you use for the purpose of defining a new choice criterion expressed by an evaluation function on the domain of a constrained integer variable under consideration during the solution search. That evaluation function is of type IlcEvalInt to make the choice on the domain of a constrained integer variable.

See Also:

Method Summary
public IlcIntSelectEvalI(IlcEvalInt function)
public virtual IlcIntselect(IlcIntVar var)
Inherited Methods from IlcIntSelectI
IlcIntSelectI, select, ~IlcIntSelectI
Method Detail

IlcIntSelectEvalI

public IlcIntSelectEvalI(IlcEvalInt function)

This constructor creates an implementation object accompanied by an evaluation function. Objects of this class use that evaluation function to choose a value from the domain of a constrained integer variable during the search for a solution.


select

public virtual IlcInt select(IlcIntVar var)

This virtual member function returns one of the values of the domain of the constrained integer variable var. In order to do this, it calls the evaluation function for each value in the domain of the constrained integer variable var. For each of these values, the evaluation function is called with the value and the variable as arguments. Then the member function select returns the value for which the evaluation function returned the smallest integer.