[gecode-users] scheduling problem, tow branchers, order of branching

Christian Schulte cschulte at kth.se
Mon Aug 8 15:54:02 CEST 2016


Hi,

 

Sorry for the delay – summer holidays…

 

I think you will have to implement a brancher yourself, as described in Part B of MPG.

 

However, if you already know the order in which you want to branch (your example suggests that)( you can do the following which is not super-efficient but should work:

 

for (int i=0; i≤ maxtasks; i++) {

  branch(*this, QuantityTask[i], INT_VAL_MIN());

  assign(*this, WorkTimeTask[i], SET_ASSIGN_MIN_INC());

}

 

This creates a whole bunch of branchers run in order of creation, please read Section 8.1.

 

Cheers

Christian

 

--

Christian Schulte, www.gecode.org/~schulte

Professor of Computer Science, KTH,  <mailto:cschulte at kth.se> cschulte at kth.se

Expert Researcher, SICS,  <mailto:cschulte at sics.se> cschulte at sics.se

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Wu Shaowei
Sent: Friday, July 29, 2016 12:18
To: users at gecode.org
Subject: [gecode-users] scheduling problem, tow branchers, order of branching

 

Hi to everyone on the ML,
I am working on a scheduling problem,I have two variable array:
IntVarArray QuantityTask;
SetVarArray WorkTimeTask;
 
ant two branchers:
branch(*this,QuantityTask,INT_VAR_NONE(),INT_VAL_MIN());
assign(*this,WorkTimeTask,SET_ASSIGN_MIN_INC());
 
Asume I have 2 tasks, Gecode's default enumration order is:
(branch)QuantityTask[0]-->(branch)QuantityTask[1]-->(assign)WorkTimeTak[0]-->(assign)WorkTimeTask[1],
how can I achieve this:
(branch)QuantityTask[0]-->(assign)WorkTimeTak[0]-->(branch)QuantityTask[1]-->(assign)WorkTimeTask[1]
 
I have read MPG 8.14 Executing code between branchers,
and http://www.gecode.org/pipermail/users/2015-April/004669.html,
but has not a clue.
 
Thank you!
Best,
Wu Shaowei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20160808/749a08aa/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4623 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20160808/749a08aa/attachment.bin>


More information about the users mailing list