Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Production modes (single and mix)

    Posted 07/25/19 11:38 AM

    Originally posted by: AndyHam


    Please give me advice how to model the following problem. With several years experience in CP, I could not come up with any solution. Thanks!
    A company 24*7 operates one machine. The machine can run either single-processing (one type of job at a time) or mix-processing (two types of job at a time) modes. The mix-processing mode is slower than single-processing. However, the company sometimes uses the mix-processing in order to meet a due date. An ideal scheduling output is as follows:

    Job  Qty  Start End  Mode

    1       6    0        12     "Single"

    2       10  12      42     "Mix"

    3       10  12      42     "Mix"

    1       16   42     74     "Single"

    ….

     

    //Sample inputs

    int pt_Single=2; //Hours
    int pt_Mix=3; //Hours

    tuple t_Plan {
        key int job;
        key int release; //Date
        key int due;     //Date
        int qty;
    };
    {t_Plan} Plan={
    <1, 0, 2, 10>,
    <2, 0, 2, 10>,
    <3, 0, 2, 10>,
    <1, 1, 3, 12>,
    <2, 1, 3, 8>,
    <3, 1, 3, 12>,
    <1, 2, 4, 9>,
    <2, 2, 4, 11>,
    <3, 2, 4, 7>
    };


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Production modes (single and mix)

    Posted 07/29/19 04:53 AM

    Originally posted by: PhilippeLaborie


    I'm assuming each job in the plan is non-preemptive so that one interval variable is used to produce the full quantity.

    So I'm focusing on the modeling of the machine. It is a muti-mode scheduling problem: each job can be executed with 2 possible modes: single or mix. The usual way to formulate this type of problem is to use one optional interval variable for each mode and an alternative constraint.

    Here, you can model the machine as a cumulative resource of capacity 2 but that is such that the capacity is restricted to 1 during the execution of a single-processing job (thanks to an 'alwaysIn' constraint).

    Here is the corresponding model (I'm not sure of the time-units, I used the release time as a hard constraint and the due date as a soft constraint, trying to minimize the tardiness).

     

    using CP;
    
    int H = sum(i in Plan) i.qty*pt_Mix;
    
    dvar interval job      [i in Plan] in i.release*24..H;
    dvar interval jobSingle[i in Plan] optional size i.qty*pt_Single;
    dvar interval jobMix   [i in Plan] optional size i.qty*pt_Mix;
    
    cumulFunction machine = sum(i in Plan) pulse(job[i],1);
    
    minimize sum(i in Plan) maxl(0,endOf(job[i])-i.due*24);
    subject to {
      forall(i in Plan) {
        alternative(job[i], append(jobSingle[i],jobMix[i]));
        alwaysIn(machine,jobSingle[i],1,1);
      }
      machine <= 2;
    }
    

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Production modes (single and mix)

    Posted 08/01/19 09:37 AM

    Originally posted by: AndyHam


    This is exactly what I was looking for. I have ported the suggested code into the original model. It works great!
    I think I understand the code, but I could not come up with it for myself ^^.  
    Still long days to learn! This is another great lesson for me.
    Thanks IBM!

    Industries are clearly seeing benefits of CP, but they have some legacy systems which hold back the adoption of CP.
    But the day must come.
     


    #DecisionOptimization
    #OPLusingCPOptimizer