Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How add a due date constraint to flexible job shop model?

    Posted 05/30/15 04:58 PM

    Originally posted by: Mclovin


    This is the model OPL from CPLEX Optimization Studio 12.6.

    I need add to due date constraint to this.

     

    using CP;
    int nbJobs = ...;
    int nbMchs = ...;
    range Jobs = 1..nbJobs;
    range Mchs = 1..nbMchs;


    //{string} Mchs=...;
    //{string} Jobs=...;

    tuple Operation {
      int id;    // Operation id
      int jobId; // Job id
      int pos;   // Position in job
    };
    tuple Mode {
      int opId; // Operation id
      int mch;  // Machine
      int pt;   // Processing time
    };
    {Operation} Ops   = ...;
    {Mode}      Modes = ...;

     

    // Position of last operation of job j
    int jlast[j in Jobs] = max(o in Ops: o.jobId==j) o.pos;

    dvar interval ops  [Ops]; 
    dvar interval modes[md in Modes] optional size md.pt;
    dvar sequence mchs[m in Mchs] in all(md in Modes: md.mch == m) modes[md];

    execute {
              cp.param.FailLimit = 10000;
    }

    minimize max(j in Jobs, o in Ops: o.pos==jlast[j]) endOf(ops[o]);
    subject to {
      forall (j in Jobs, o1 in Ops, o2 in Ops: o1.jobId==j && o2.jobId==j && o2.pos==1+o1.pos)
        endBeforeStart(ops[o1],ops[o2]);
      forall (o in Ops)
        alternative(ops[o], all(md in Modes: md.opId==o.id) modes[md]);
      forall (m in Mchs)
        noOverlap(mchs[m]);

        
    }

    execute {
      for (var m in Modes) {
        if (modes[m].present)
          writeln("Operation " + m.opId + " on machine " + m.mch + " starting at " + modes[m].start);
      }
    }


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How add a due date constraint to flexible job shop model?

    Posted 05/31/15 03:20 PM

    Hi

    have you tried to use 

    endOf for an interval ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: How add a due date constraint to flexible job shop model?

    Posted 06/01/15 08:27 AM

    Originally posted by: Mclovin


    I tried with this code for due date but it didn't work for all due date that i wanted to use.

    Float D [Jobs] =...;

     

    forall (j in Jobs , o in Ops)

         endOf (ops[o] )<= D[ j ];


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: How add a due date constraint to flexible job shop model?

    Posted 06/02/15 07:01 AM

    Originally posted by: PhilippeLaborie


    Hello,

    Can you be more precise?

    What do you exactly mean by "due-date"? Usually in scheduling a "due-date" is a date after which the execution of an activity incurs some cost. How is defined the objective function in your problem? Or do you mean a "deadline", that is, the activity is required to finish before that date.

    Also, do you have one due-date per job ? per operation? one global due-date for the complete schedule?

    What do you mean by "it didn't work for all due date" ? The syntax is not accepted? The model is proved to be infeasible? The engine is not able to find a feasible solution?

    Philippe


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: How add a due date constraint to flexible job shop model?

    Posted 06/02/15 10:38 AM

    Originally posted by: Mclovin


    Hi Philippe,

     

    In the problem of flexible job shop model, the objective function refers to makepan. So, I wanted to create a constraint not a objective with cost.

    The constraint is about the due-date per job and my problem consisted in it didn't consider all the due date that I included in the data. I just could to put one due date for a corresponding Job and the other data was just a big number. When I put more than one due date (different to the big number) It didn't work.

    I discovered that my mistake was in the definition of the constraint (marked with italics):

    forall(j in Jobs,o in Ops: o.jobId==j) 

        endOf(ops[o])<= D[j]; 

    But now its ok, and Cplex shows a solution for all the changes I put on the data for each duedate of corresponding JOB. So the problem was solved.

    I really appreciate your interest in helping me. 

    Regards

    Ahmed


    #DecisionOptimization
    #OPLusingCPLEXOptimizer