Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  can it be more efficent using transition

    Posted 02/03/12 05:13 AM

    Originally posted by: qtbgo


    Hello, I have a code like

    
    forall(v, w in 1..q: v < w) forall(i, j in  1..n: i !=j && l[i] > l[j] - (s + 1) * ftoi(abs(v-w)) )
    { endOf(qcTasks[w][j],0) + (l[i] - l[j] + (s + 1) * ftoi(abs(v-w)))  <= startOf(qcTasks[v][i],H) || endOf(qcTasks[v][i],0) + (l[i] - l[j] + (s + 1) * ftoi(abs(v-w)))  <= startOf(qcTasks[w][j],H)  ; 
    };   This code runs fast, but still not supassing another algrithm. So I wonder 
    
    if it can be modeling more efficiently?   Here, dvar interval  qcTasks[1..q][1..n] is optional. q is the number of quay cranes and n the number of tasks.   I want to use transition time( which is l[i] - l[j] + (s + 1) * ftoi(abs(v-w))) to model 
    
    this situation and use noOverlap. But I find it difficult to define Type of interval because it depends on i, j ,v , w.   Now  it is defined as   dvar interval qcTasks[k in 1..q][j in 1..n] optional in 0..1000 ;   q is 10, n is 100.
    


    I want to know if using transition time is better? if so, how to do it?
    thanks
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: can it be more efficent using transition

    Posted 02/03/12 07:00 AM

    Originally posted by: SystemAdmin


    Hello,
    If, beside the transition distance, the intervals qcTasks cannot overlap, then you can use a type for each pair (k,j) and use a transition distance:

    
    
    
    int Type[k in 1..q][j in 1..n] = n*(k-1)+(j-1); tuple triplet 
    { 
    
    int i; 
    
    int j; 
    
    int v; 
    } 
    {triplet
    } dist = 
    { <Type[v][i], Type[w][j], l[i] - l[j] + (s + 1) * ftoi(abs(v-w))> | v, w in 1..q, i, j in 1..n: (i!=j) && (l[i] > l[j] - (s + 1) * ftoi(abs(v-w))) 
    };   dvar interval qcTasks[k in 1..q][j in 1..n] optional in 0..1000 size d[j];   dvar sequence seq in    all(k in 1..q, j in 1..n) qcTasks[k][j] types all(k in 1..q, j in 1..n) Type[k][j];   constraints 
    { noOverlap(seq, dist); 
    }
    

    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: can it be more efficent using transition

    Posted 02/03/12 07:30 PM

    Originally posted by: qtbgo


    Very elegent, I learn much from you, thank you, Philippe.
    But unfortunately, only when v < w and (i!=j) and (l[i] > l[j] - (s + 1) * ftoi(abs(v-w))) , qcTasks cannot overlap, otherwise, it can.

    Is there a faster formulation to cope with this?
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: can it be more efficent using transition

    Posted 02/07/12 05:56 AM

    Originally posted by: SystemAdmin


    Hello,
    It is not clear if there is a more efficient formulation if we consider this constraint alone.
    What is this constraint supposed to model? What is the meaning of l[i], v and s? How do they relate with the start/end or length of interval variables qcTasks ? Is the subset of tuples (i,v,j,w) that satisfies the condition for posting the constraint you mention a dense or a sparse subset of the full cartesian product ?
    I understand that v corresponds to some quay crane. For a given task i, are intervals qcTasks[v][i] different alternatives for executing a task on a quay crane?
    Philippe
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: can it be more efficent using transition

    Posted 02/09/12 08:14 PM

    Originally posted by: qtbgo


    Thank you Philppe.

    My English is poor, I cannot express the whole thing clear.
    For now, I can't post the mod here. If you have time, could you be kind enough to send a email to me so that I can send the mod and the background information to you.
    My email is: qtbgo@163.com
    #DecisionOptimization
    #OPLusingCPOptimizer