Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Interval fragments

    Posted Wed June 05, 2013 03:37 PM

    Originally posted by: drhachmann


    My model have several intervals with startOf and sndOf, say:

    [1,30], [45,65], [186,190], in minutes

    I would like to minimize the total hours of intervals.

    In the above example would be 3: [1,60], [61,90], [180, 240].

    How Can I model this?

    Thanks.

     

     


    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: Interval fragments

    Posted Thu June 06, 2013 09:15 AM

    Originally posted by: GGR


    Hi

    I do think you not give enough information to have a correct answer. Nevertheless. That means

     

    The size of the problem in number of interval for processing activities

    Which is the structure of the resource that executes these interval

    Is your <<hours>> to count are fixed or gliding? By fix I mean they start periodically at the same minute, by gliding that is a segment of time, idle for the processing machine.

    I will now propose you some hypothesis: the processing machine is an unary resource (a sequence of intervals) such that it should not be idle for more than one hour.

    That is I used the startOfNext expression on the sequence of interval (please refer to the documentation if you do not know this features.and I sum the number of time it is greater that the endOf the interval + 1 hour.

    <code>

    sum all(i in Intervals) (startOfNext(sequence, intervals[i], origin, origin) + 60 <= endOf(intervals[i],, origin));

    <code>

     

     


    #ConstraintProgramming-General
    #DecisionOptimization


  • 3.  Re: Interval fragments

    Posted Thu June 06, 2013 01:54 PM

    Originally posted by: drhachmann


    HI GPR, thanks for your answer.

    So,

    I have n tasks to scheduling on m machines. Each task has a duration depending on the machine where it runs. 

    The scheduling have granularity of minutes.

    For exemple, task A can be allocated on the machine X in interval [15,25] (minutes) and task B can be allocated on the machine X in interval [30,80] (minutes).

    The cost for use a machine is charged per hour. So for the example above, would be charged for 2 hours : [15,74], [75,135], although the machine is not used all the time. Like Amazon charges by use their instances (http://aws.amazon.com/ec2/)

    Other exemple:

    Cost per hour: $0.10

    <machine> :  <task>[<start,end>] | <total cost>

    X : a[45,61]                           | $0.10

    Y:  b[125,130],  c[150,170]   | $ 0.10

    Z:  d[0,59]                             | $ 0.10

    W:  e[55,65], f[115,125]         | $0.20

    K: f[2, 200]:                           | $0.40

     

    Total cost: $1.10

    How Can I model this?

     

    regards,

    Diego Rodrigo Hachmann


    #ConstraintProgramming-General
    #DecisionOptimization


  • 4.  Re: Interval fragments

    Posted Mon June 10, 2013 06:02 AM

    Originally posted by: GGR


    Hi

     

    From the samples you gave the cost expression are in OPL:

    If only one interval a is involved:  (div(i, j) is the integer division of i by j)

    div(lengthOf(a) + 59, 60)

     

    if 2 intervals a and b are involved, a preceding b

    div(endOf(b) - startOf(a) + 59, 60) - max_l(0, div(startOf(b) - startOf(a) , 60) - div(endOf(a)  - startOf(a) + 59 , 60) );

    I figure out Amazon charges rules proposes an explicit algebraic  formulation (for their own sake and the ones of their customers). You should try to find it out.

     

    Hope that helps

     

     


    #ConstraintProgramming-General
    #DecisionOptimization