Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Setup in a job shop scheduling problem

    Posted 11/30/19 12:25 PM

    Originally posted by: RuiFig


    Hi,

    I am developing a model to schedule a job shop. I am now trying to add the setups. I followed the cp optimizer example however when I run the model it doesn't consider the setups. I added a matrix with the setup times, created a tuple with the machines and the setups and used the noOverlap function with the tuple and the sequence type variable of the machines, as in the exemples, but it doesnt work.

    Can anyone help ? 

    using CP;
    
    int nbMaq = ...;
    range Maq = 1..nbMaq; 
    
    int nbEncomendas = ...;
    range Encomendas = 1..nbEncomendas;
    
    
    int Maquinas[j in Encomendas][m in Maq] = ...;
    int Duracao[j in Encomendas][m in Maq] = ...;
    int DataEntrega[Encomendas]=...;
    
    int Setup[Maq][Encomendas][Encomendas]=...;
    
    
    tuple triplet { int t1; int t2; int v; }
    {triplet} tt[m in Maq] =   { <t1,t2,Setup[m][t1][t2]> | t1,t2 in Encomendas };
    
    dvar interval itvs[j in Encomendas][o in Maq] size Duracao[j][o] intensity Calendar[Maquinas[j][o]];; //criar intervalo de processamento
    
    dvar sequence mchs[m in Maq] in all(j in Encomendas, o in Maq : Maquinas[j][o] == m && Duracao[j][o]!=0  ) itvs[j][o]; // criar sequencia de processamento
    
    
    dexpr int atraso =sum(j in Encomendas) maxl(0, endOf(itvs[j][nbMaq]) - DataEntrega[j]);
    minimize atraso;      // minimizar o atraso total 
    //minimize  (max(j in Encomendas) endOf(itvs[j][nbMaq-1]));                                                             // minimizar o makespan
            subject to {
     
                    
    forall (m in Maq) {
                      noOverlap(mchs[m],tt[m], 1); // garantir que a maquina só é usada por uma tarefa de cada vez
                 
       }    
       
                    forall (j in Encomendas, o in 1..nbMaq-1){
                    endBeforeStart(itvs[j][o], itvs[j][o+1]); // garantir que a sequencia dos processos é respeitada
                       
        }
     }     
     
     
    
    

     


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Setup in a job shop scheduling problem

    Posted 12/04/19 01:20 PM

    Originally posted by: GGR


    Hi

     

    I am surprised the model works.

    The transition matrix in noOverlap(mchs[m],tt[m], 1) should be a tuples set of (type, type, distance)

     

    Moreover I can not see the whole sequence declaration. If the types of an interval variables is not used in distance tuples set, it is considered be 0.

     

    Hope that helps


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Setup in a job shop scheduling problem

    Posted 12/05/19 04:20 AM

    Originally posted by: RuiFig


    First of all thanks for the reply,

     

    I'm new to clpex, so sorry for any stupid question. when you talk about transition matrix you refer to the setup times right ?

    you mean that when i do this declaration: 

    int Setup[Maq][Encomendas][Encomendas]=...;

    tuple triplet { int t1; int t2; int v; }
    {triplet} tt[m in Maq] =   { <t1,t2,Setup[m][t1][t2]> | t1,t2 in Encomendas };

     

    the matrix named setup should be a interval variable ?

     


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Setup in a job shop scheduling problem

    Posted 12/06/19 07:05 AM

    Originally posted by: PhilippeLaborie


    I think that one thing that is missing in the model is that, when you define the sequence variable,  you need to associate an integer type with each interval variable that will represent the index of this interval variable in the transition matrix. Maybe something like:

    dvar sequence mchs[m in Maq] 
       in all(j in Encomendas, o in Maq : Maquinas[j][o] == m && Duracao[j][o]!=0  ) itvs[j][o]
       types all(j in Encomendas, o in Maq : Maquinas[j][o] == m && Duracao[j][o]!=0  )  HERE INTEGER INDEX OF INTERVAL itvs[j][o];
    

    From your model, it could be that the integer index of interval variable itvs[j][o] is just 'j'

     


    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: Setup in a job shop scheduling problem

    Posted 12/06/19 08:54 AM

    Originally posted by: RuiFig


    Hi Philippe, thank you a lot for your answer, i tried and it works perfetly !


    #CPOptimizer
    #DecisionOptimization