#include /*a simple example of value ordering: SDF - smallest domain first*/ ILOSTLBEGIN IlcChooseIndex1(MyChooseVar, var.getSize(), IlcIntVar) class mySelectI: public IlcIntSelectI { public: mySelectI(){} virtual IlcInt select(IlcIntVar var); }; IlcInt mySelectI::select(IlcIntVar var) { IlcInt domSize = var.getSize(); IlcInt lowerBound = var.getMin(); return lowerBound + domSize*rand()/(RAND_MAX+1); } IlcIntSelect mySelect(IloSolver solver) { return new (solver.getHeap()) mySelectI(); } ILOCPGOALWRAPPER1(MyGenerate, solver, IloIntVarArray, vars) { return IlcGenerate(solver.getIntVarArray(vars), MyChooseVar); } int main(int argc, char* argv[]){ int seed = atoi(argv[1]); srand(seed); IloEnv env; IloModel model(env); int sizeArr = 5; IloNumVarArray xArr(env, sizeArr); xArr[0] = IloNumVar (env,-3,5,ILOINT); xArr[1] = IloNumVar (env,-2,4,ILOINT); xArr[2] = IloNumVar (env,-1,3,ILOINT); xArr[3] = IloNumVar (env,0,2,ILOINT); xArr[4] = IloNumVar (env,1,2,ILOINT); model.add(xArr); model.add(xArr[0]>=xArr[4]); IloSolver solver(model); IloGoal goal = MyGenerate(env, xArr); if (solver.solve(goal)) { for (int i=0;i