I cannot see from your program how startOrder and order are initialized as variables. Then, the two first calls to post apparently are calls you implemented yourself, so I again cannot see what is happening.
Christian -- Christian Schulte, www.ict.kth.se/~cschulte/ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Narasinga Rao Sent: Sunday, November 23, 2008 10:53 AM To: [EMAIL PROTECTED] Subject: [gecode-users] How to put constratins on sort order variables ! Dear all, I would like to know how to post the constraints on sort order variables. The basic idea is 1. First we need to order the tasks based on the start times (basically a sorting based on start times) 2. Post some constraints on the derived ordered start times Here is the example code... IntVarArray start; IntVarArray end; IntVarArray startOrder; IntVarArray order; ..................... ..................... ..................... // start and end constraints are well defined ..................... ..................... for( int i=0; i<nTasks; i++) { post( this, start, order[i], startOrder ); post( this, end, order[i], endTimeStamps ); if( i < nTasks-1 ) post( this, startOrder[i] < startOrder[i+1] ); } // Adding some post constraints on the ordered tasks for( int i=0; i<nTasks-1; i++ ) { post( this, endTimeStamps[i] + switchingCost[i+1] < startOrder[i+1] ); } If we add the above constraint, it is not providing any solution. Instead if we give the same constraints with predefined input order values like given below, it is providing solution. int order[] = { 0, 1, 2, 3, 4, 5 }; ...................... for( int i=0; i<nTasks-1; i++ ) { post( this, endTimeStamps[i] + switchingCost[i+1] < start[order[i+1]] ); } Can any body help me in providing the solution. Thanks in advance... -- --------------------- With Regards, Narasinga Rao, Miniskar, IMEC, Belgium.
_______________________________________________ Gecode users mailing list [EMAIL PROTECTED] https://www.gecode.org/mailman/listinfo/gecode-users