Decision Optimization

 View Only
  • 1.  CP Optimizer | Maximum levels of renewable resources considering work shifts

    Posted Mon July 25, 2022 10:30 AM
    Hi all,

    I'm trying to solve a variant of the Constrained Resource Project Scheduling Project via CP Optimizer.
    The tasks consume some renewable resources during their execution (manpower, pieces of equipment, energy, etc.).
    The objective of the problem is to minimize the levels of some of these renewable resources.
    Since the problem considers a specific calendar with three work shifts and non-working days (weekends), I'm using a step function to characterize the intensity of each task's interval variable.

    For each renewable resource, the contribution of each activity (IloPulse) is summed into an IloCumulFunctionExpr. Then the maximum level of each IloCumulFunctionExpr is limited by an integer variable, which is minimized in the objective function.
    Thus, my current model minimizes the maximum levels of these renewable resources used over the whole planning horizon (i.e., from the first period to the last period of the planning horizon).
    However, I would like to distinguish the maximum level of each renewable resource for each of the work shifts.
    For instance, the first work shift corresponds to the first eight hours of each working day.

    Is there any way/strategy to model this via CP Optimizer?

    Best regards,
    M. Martin.

    ------------------------------
    Mateus Pereira Martin
    ------------------------------

    #DecisionOptimization


  • 2.  RE: CP Optimizer | Maximum levels of renewable resources considering work shifts

    Posted Tue July 26, 2022 04:49 AM
    Hello Mateus,
    There might be different ways to model this...
    Anyway, you'll need one instance of an IloCumulFunctionExpr for each pair (resource, work shift).
    I'm assuming here that each task is statically assigned to a work shift.
    Then, it is possible to sum all IloCumulFunctionExpr over all work shifts, for each resource to create another IloCumulFunctionExpr.
    In this way, you may add constraints on renewable resources by shifts, or overall.
    Hoping this solves your question,
    Kind regards,
    Hugues

    ------------------------------
    Hugues Juille
    ------------------------------



  • 3.  RE: CP Optimizer | Maximum levels of renewable resources considering work shifts

    Posted Tue July 26, 2022 08:07 AM
    Hi Hugues,

    Thank you for your reply.
    The tasks are not assigned to a work shift, since the duration of a task is generally longer than a work shift.
    Moreover, a task may start in one week and end in the next week (the task is suspended during the weekend).

    For each renewable resource and work shift, my initial idea was to measure the difference between the maximum level of the renewable resource for the whole planning horizon and the level of the renewable resource used during the work shift. For instance, the first work shift would have an auxiliary interval variable with: (i) a fixed start/end (the first/last period of the planning horizon); (ii) the value of 100 as the intensity during the first eight hours of a weekday, and zero otherwise. Thus, this auxiliary interval variable would have an IloPulse with a variable height seeking to complement the maximum level of this renewable resource.
    Unfortunately, this initial idea did not work, as the usage of a renewable resource (IloPulse(task, hmin,hmax) in the IloCumulFunctionExpr) seems to be maintained even when the task is suspended with an intensity value of zero. Another possibility is that I miscoded this proposal.
     
    Please, would you have any other suggestions?

    Best regards,
    M Martin.

    ------------------------------
    Mateus Pereira Martin
    ------------------------------



  • 4.  RE: CP Optimizer | Maximum levels of renewable resources considering work shifts

    Posted Tue July 26, 2022 11:59 AM
    Hello,
    a classic approach is the following:
    Let f be a cumul function,
    Let T_i the period where you need the max level reached by f (one work shift in your case)
    let MAX the max capacity (or a bound) of f

    Let us introduce g = pulse(T_i,0,MAX)
    Add the constaint f+g<=MAX
    Define f_max_i = MAX - heightAtStart(g,T_i)
    Now if we maximize f_max_i, it will be the max level of f on T_i

    It depends on what you exactly want to do. If for example you want to minimize the sum of all the f_max_i, that will maximize each f_max_i, and the above model will do what you want.

    ------------------------------
    Olivier Lhomme
    ------------------------------



  • 5.  RE: CP Optimizer | Maximum levels of renewable resources considering work shifts

    Posted Wed August 03, 2022 11:29 AM
    Hello Olivier,

    Thank you very much!
    I was able to model these maximum levels of renewable resources considering the work shifts based on your suggestion.

    For your information, my initial idea was to use a single interval variable A_i per work shift i and renewable resource.
    For instance, the first work shift corresponds to hours 0-8, 24-32, 48-56, and so on.
    In this case, the interval variable A_1 would be suspended during the other work shifts and weekends (e.g., 8-24, 32-48, 56-72, and so on).
    But apparently, the resource usage IloPulse(A_i,0,MAX) is not removed from IloCumulFuntionExpr while the task is suspended (calendar with an intensity value of zero). And unfortunately, that was the premise for this idea to work.

    Best regards,
    Mateus.

    ------------------------------
    Mateus Pereira Martin
    ------------------------------