Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
Expand all | Collapse all

Mismatch in interval and optional interval

  • 1.  Mismatch in interval and optional interval

    Posted Sat November 26, 2016 09:25 PM

    Originally posted by: Tentons


    Hello,

    I'm trying to do a very simple scheduling program. Having N workers and M jobs with certain lengths and worker requirements.
    I want to see each worker's schedule.

    using CP;

    int Workers = 6;

    int Jobs = 10;

    tuple Job {

         int duration;

         int workforce;

    }

    Job JobList[1..Jobs] = [<4, 5>, <6, 3>, <5, 2>, <6, 1>, <2, 2>, <4 , 3>, <5, 2>, <9, 2>, <8, 5>, <3, 6>];

    dvar interval schedule[j in 1..Jobs] size JobList[j].duration;

    dvar interval assignment[1..Jobs][1..Workers] optional;

    dvar sequence workerSchedule[w in 1..Workers] in all (j in 1..Jobs) assignment[j][w];

    cumulFunction working = sum (j in 1..Jobs) pulse(schedule[j], JobList[t].workforce);

    minimize max (j in 1..Jobs) endOf(schedule[j]);

    subject to {

         working <= Workers;

         forall (j in 1..Jobs)

              alternative(schedule[j],

                                  all (w in 1..Workers) assignment[j][w]),

                                  JobList[j].workforce);

         forall (w in 1..Workers)

              noOverlap(workerSchedule[w]);

    }

     

    The resulting schedule is correct. However the resulting assignment is quite glitched when I open it in Data View. First in the tableView only first few lines are filled, rest is blank. Then in the Gantt chart of assignment one of the worker's job is completelly off, shifted than it is in schedule. As it's shown in picture (above Gantt is for assignment, bottom one is for schedule).

     

    What causes this misalignment? Thank you.

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Mismatch in interval and optional interval

    Posted Sun November 27, 2016 10:19 AM

    Hi,

    I guess You use 12.6.3

    So You should read

    https://www.ibm.com/developerworks/community/forums/html/topic?id=3faff55b-f6ab-416b-a452-bda2e22e5fba&ps=25

    You Could either use the tip or move To Cplex 12.7

    regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Mismatch in interval and optional interval

    Posted Sun November 27, 2016 10:28 AM

    Originally posted by: Tentons


    Hi Alex,

    thank you very much. The tip worked flawlessly and the display is now fixed.


    #DecisionOptimization
    #OPLusingCPOptimizer