Originally posted by: AlCPLEX
Thank you for your answer.
Nevertheless, I am not sure it really does what i want (i or maybe i did not understand it).
On your example : it looks like it branches first on the element of S2 than the last element of S2 and then whatever seems the best.
i would like to branch on a variable of S2 that meet some criteria, and if there are severeal variables that satisfy it, then use another criteria as differentiator.
Here is a quick (and stupid) example which has nothing to do with my problem but that might be used to illustrate :
*****************************
using CP;
int nTasks = 20;
int nPeople= 4;
range rTasks = 1..nTasks;
range rPeople = 1..nPeople;
int cost[i in rTasks] = i;
dvar int people[i in rPeople] in rTasks;
dexpr int objective = sum(i in rPeople) cost[people[i]];
execute{
var f = cp.factory;
// Variable selector : how to choose the people variable that has:
// - the biggest/specific value in its domain
// - if severeal variables have this value then take the one with the smallest domain
// var phase1 = f.searchPhase(???);
// cp.setSearchPhases(phase1);
}
maximize objective;
subject to {
allDifferent(people);
forall (i in rPeople){
cost[people[i]] <= maxl(3,4*i - 4);
}
}
*****************************
Any help is welcomed.
Thank you ,
Sincerely
#DecisionOptimization#OPLusingCPOptimizer