Decision Optimization

Decision Optimization

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

 View Only
  • 1.  penalty on interval coverage

    Posted Wed January 20, 2016 05:59 AM

    Originally posted by: qtbgo


    Hi, Suppose we have a interval variable itv. I want that if it overlap with a time period, say [3,5], a penalty should imposed in the objective function.

    How to model this?

    thanks in advance.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: penalty on interval coverage

    Posted Wed January 20, 2016 06:03 AM

    Originally posted by: qtbgo


    I guess I can use overlapLength, that is in the objective function we have penalty term minimize overLapLength(ivt, 3,5).

    Now, another question.

    Suppose we have an interval variable array x[i in 1..10] in 0..1000 size 1..5, which are not overlaped (we impose noOverlap(x)).

    and we have some hole such as [3,5], [10,11], [21,24], which are implemented as tuples and included in a set called Holes ({<3,5>,<10,11>, <21,24>, } ) etc. any coverage on these holes will be penalize in the objective. So, we have:

    minimize  sum( i in 10, j in Holes)overLapLength(x[i], j.t1, j.t2)

     

    But I guess this objective is not the best way to model this case, because it compares all pairs of i, j which is not necessary . it seems we can use a piecewise linear function to model the cost of holes,but I cannot figured it out.

    Can anyone help me?

     

     

     

     

     

      

     

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: penalty on interval coverage

    Posted Wed January 20, 2016 08:23 AM

    Originally posted by: PhilippeLaborie


    You can use the notion of intensity function as follows:

    1. You define a stepFunction h with value 100 (100%) during the holes and value 0 outside the holes.

    2. Your intervals in the noOverlap constraint are defined with this intensity function. the intensity function will ensure the following relation between the size and the start/end/length of each interval variable:

    size = sum(start->end) h(t) / 100

    length = end-start

    So 'size' will be the total duration of the interval variable executed inside the holes, this is what you want.

    Be careful then that you need to specify a 'length' and not a 'size' when defining the "duration" of the interval variable.

    So instead of doing:

    dvar interval x[i in 1..10] in 0..1000 size 1..5;
    


    You need:

    dvar interval x[i in 1..10] in 0..1000 intensity h;
    
    forall(i in 1..10) {
     1 <= lengthOf(x[i],1) <= 5;
    }
    

    Then you can directly minimize:

    minimize sum(i in 1..10) sizeOf(x[i],0);
    

    Two remarks:
    1- there is an example of manipulation of step functions and intensity functions in the delivered example sched_calendar

    2- of course if your interval variables already have some intensity function defined for other reasons, you will need to duplicate the variables and synchronize them (with startAtStart/endAtEnd constraints).

     

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: penalty on interval coverage

    Posted Thu January 21, 2016 07:19 AM

    Originally posted by: qtbgo


    Very interesting, I didn't know that size can be 0 when length is not 0 before.


    #DecisionOptimization
    #OPLusingCPOptimizer