wonsuk.choi
unread,Aug 11, 2011, 10:50:08 AM8/11/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to or-tools-discuss
Hello
I got the solution about this problem by virtue of your help
Here is my java code.
-------------------------------------------------------------------------------------
IntVar[] presence = new IntVar[machineset.size()];
IntVar selection = solver.makeIntVar(0, machineset.size()-1];
for(int i = 0; i < machineset.size(); i++)
{
presence[i] = solver.makeBoolVar("presence of member " + i);
IntervalVar member = machineset.get(i);
solver.addConstraint(
solver.makeIntervalVarReleation(master,
solver.START_AT_START, member));
solver.addConstraint(
solver.makeEquality(
presence[i].Var(),
member.PerformedExpr().Var));
}
solver.addConstraint(
solver.makeSumEquality(presence, 1));
sover.addConstraint(
solver.makeMapDomain(selection, presence));
---------------------------------------------------------------------------------------
because each member's duration time is different,
I could not use the new relation StaysInSync.
I have got the same objective value (makespan) as legacy system.
In case of 5 jobs, 10 machines, 14 operations,
It takes only 47ms to complete, :-)
but when I doubled the job number to 10, it took long time.
I think I have to make my own DecisionBuilder for the faster search.
I will keep trying to study or-tools to understand the idea.
Thanks.
Best regards
wonsuk choi