Skip to main content
FRAMES NO FRAMES

Macro IlcChooseIndex2

Definition file: ilcp/cpext.h
IlcChooseIndex2
Macro to define a new variable choice function.

This macro defines a new choice function (a criterion) in CP Optimizer for setting parameters on the search for a solution; you use this macro if you have two integer criteria.

This macro defines a choice function for constrained variables of type varType. The name of the function will be name. The second and third arguments, criterion1 and criterion2, should be C++ expressions of type IlcInt. In these expressions, the constrained variable to evaluate must be denoted by var. The index of the variable in the array is varIndex. The function named name returns the index of the constrained variable of type varType that minimizes the expressions criterion1 and criterion2. If more than one constrained variable minimizes the first criterion, then the second criterion will be used to distinguish between them. If all the constrained variables have already been fixed, then this function returns -1.

See Also: