Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Export Sequence Variable Output

  • 1.  Export Sequence Variable Output

    Posted Thu November 03, 2016 02:20 PM

    Originally posted by: SatishA


    Hi All,

    I am trying to solve a job shop scheduling problem with the following sequence variable and no overlap variable with changeover time.

    int taskType[k in PO_TASK_AR_SEQ_ALT_COMB]= k.po;
    int taskType2[k in Machine_Shutdown_Details_Comb]= 999;
    
    tuple triplet { int p1; int p2; int time; }
    {triplet} tt[m in all_machines] = 
      { <t1.po,t2.po,SeqDepSetup[<m,t1.po,t2.po>].time> | t1,t2 in PO_TASK_AR_SEQ_ALT_COMB:
        <m,t1.po,t2.po> in Setup_Comb && m==ProdTime[t1].machineindex  && m==ProdTime[t2].machineindex} ;
        
    dvar sequence all_sequences[m in all_machines] 
            in append(all(k in PO_TASK_AR_SEQ_ALT_COMB:m==ProdTime[k].machineindex) all_tasks[k],
                              all(k1 in Machine_Shutdown_Details_Comb:k1.machineindex==m)all_shutdowns[k1])
            types append(all(k in PO_TASK_AR_SEQ_ALT_COMB:m==ProdTime[k].machineindex) taskType[k],
                     all(k1 in Machine_Shutdown_Details_Comb:k1.machineindex==m) taskType2[k1]);
                     
    forall(m in all_machines)
        noOverlap(all_sequences[m],tt[m],1);
    

     

    After solving the problem, I would like to find out between which two tasks, changeover is applied. For that I need to know the sequence variable details like on each machine, task position, next task/previous task. When I printed the following, I could see the details. But how can I access each of it and export this data just like we do for any other integer variable ?

    execute{
      for(m in all_machines)
       writeln("all_sequences: ", all_sequences[m]) };
    

     

    Please help me out.

     

    Thanks,

    Satish


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Export Sequence Variable Output

    Posted Fri November 04, 2016 10:06 AM

    Hi,

    in documentation for Class IloIntervalSequenceVar

    you may see

    using CP;

    range R = 1..3;

    dvar interval tia[i in R] size i;
    dvar sequence seq in tia;

    subject to {
      noOverlap(seq);

      before(seq, tia[2], tia[3]);
      prev(seq, tia[1], tia[3]);
    }

    execute {
      writeln(seq);
      writeln(seq.first() );
      writeln(seq.next(seq.first() ) );
      writeln(seq.last() );

      writeln("loop");
      var s=seq.first();
      for(var i in R)
      {
       writeln(s);
       s=seq.next(s) ;
      }
      writeln(s);
    }

    regards

     


    #DecisionOptimization
    #OPLusingCPOptimizer