Topic
  • 1 reply
  • Latest Post - ‏2014-04-09T07:48:45Z by PhilippeLaborie
WesleyJ
WesleyJ
1 Post

Pinned topic How to model resource in cyclic planning horizon using IloCumulFunctionExpr

‏2014-04-09T01:05:16Z |

how to model resource in the case of cyclic planning horizon

ex1) planning horizon = 1 day (24hours), schedule repeats every day, a interval variable represents 36 hours more than 1 day.

how to model that interval variable that must add sometime 1 pulse and sometime 2 pulse?

 IloCumulFunctionExpr res(env);

IloIntervalVar act = IloIntervalVar(env, 36);

   res += IloPulse(act,1); â€‹â€‹

 

ex2) how to model a case that a interval variable has 4 hours. and result say it starts at 22:00 and end at 2:00 in the 1 day repeating time horizon?

Updated on 2014-04-09T01:09:27Z at 2014-04-09T01:09:27Z by WesleyJ
  • PhilippeLaborie
    PhilippeLaborie
    83 Posts

    Re: How to model resource in cyclic planning horizon using IloCumulFunctionExpr

    ‏2014-04-09T07:48:45Z  

    Hello,

    One possibility is to consider not only one but n days.

    Let suppose DMax is the duration of the longest activity. Take n equals DMax / 24 rounded up, so that you know that any activity will not overlap more than n days. Then for each activity Ai, you can create n instances Ai1...Ain with temporal constraints startsAtStart(Aij,Aij+1,24). Activities Ai1 are constrained to start on day 1. These activities Aij represent the cyclic execution of Ai over n cycles 1..n.The n-th day represents some sort of steady state where the maximum amount of activities are executed (if you would have chosen a larger n, you would get the same schedule each day after this point). All these activities Aij require the resources but  you can post resource limited availability constraints only over this reference day (for instance by using alwaysIn constraints on cumul functions over this day if you are using cumulative resources).

    In your example, if you would have only activities of duration 36 or 4 hours, you would take n=2 and create 2 instance for each activity.

    The first instance of an activity that last 36h would overlap the second day (reference day) and in some cases completely cover it (when started after 12h on first day).

    For the second case you mention the activity that lasts 4h and starts at 22:00 on the first day would overlap the reference day (on 00:00..02:00) and the second instance would overlap it (on 22:00..24:00) resulting in two contributions.

    Hope it helps,

    Philippe