Skip to main content
FRAMES NO FRAMES

Class IloIntValueChooserI

Definition file: ilcp/cp.h
Map of IloIntValueChooserIIloIntValueChooserIIloIntValueChooserI
The implementation class for a value chooser in a search strategy.

A chooser of integer values is an object that is used to define search strategies. In particular, this class makes it possible to design custom value selection by redefining the pure virtual function IloInt IloIntValueChooserI::choose(IloCPEngine cp, IloIntVarArray x, IloInt index)

Method Summary
public virtual IloIntchoose(IloCPEngine cp, IloIntVarArray x, IloInt index)
public IloIntValueChooserI(IloEnv env)
public ~IloIntValueChooserI()
Method Detail

IloIntValueChooserI

public IloIntValueChooserI(IloEnv env)

This constructor creates an implementation of a value chooser. It must be called in the constructor of any sub-class of IloIntValueChooserI.


~IloIntValueChooserI

public ~IloIntValueChooserI()

As this class is abstract, a virtual destructor is provided.


choose

public virtual IloInt choose(IloCPEngine cp, IloIntVarArray x, IloInt index)

This pure virtual function must be defined to choose a value for the variable x[index]. The variable x[index] has been selected from the array x at an earlier stage. The selected value must be returned by the method. The array x is given to such a method because some value selection strategies may need the full array of variables to perform a selection.