Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

dayoff on workforce scheduling problem

Archive User

Archive UserTue December 01, 2015 06:01 AM

Archive User

Archive UserTue December 01, 2015 11:24 AM

Archive User

Archive UserWed December 02, 2015 09:56 AM

Archive User

Archive UserFri December 04, 2015 08:52 AM

  • 1.  dayoff on workforce scheduling problem

    Posted Tue December 01, 2015 06:01 AM

    Originally posted by: expir55


    Hi,

    We study on workforce scheduling problem in CP.

    I am having trouble with the following problem;

    The desicion variable is "dvar interval assign[j in agents, i in days, m in shifts] in start[m]..(start[m]+duration[m]) size duration[m];"


    This decision variable decides on which agent is assinged to which day / shift.  The model correctly decides the assignments of agents to days and shifts.


    Now, we consider dayoffs of each agent (greater than equal to 1 day) for each 7 day weekly planning period.


    The question is that "How can we provide the corresponding assign [j][i][m] become zero (or not to assign to day/shifts) for the specific time period in case of the agent is off.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: dayoff on workforce scheduling problem

    Posted Tue December 01, 2015 11:24 AM

    Originally posted by: GGR


    Hi

     

    The day off is part of the calendar constraints on your resource. You have several facilities in CP Optimizer for such a constraint please take a look to the page concepts Intensity and size and forbidden values on the CP Optimizer reference manual:

    http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.6.2/ilog.odms.ide.help/refcppopl/html/interval_variables.html?cp=SSSA5P_12.6.2%2F1-4-1-1-37&lang=en 

    and

    http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.6.2/ilog.odms.ide.help/OPL_Studio/opllang_quickref/topics/tlr_oplsch_forbidExtent.html?lang=en

     

    In Your case you must use an forbidExtent(x, F) constraint whose function F  is !=0 on the time segments at which the worker j is on dayoff and x one of the interval of agent i.

    Hope that helps

     

    PS By the way I am surprise your intervals are not optional?

     

     

     

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: dayoff on workforce scheduling problem

    Posted Wed December 02, 2015 03:35 AM

    Originally posted by: expir55


    Hi Rogerie,

    First of all, thank you so much for your answer.

    I wrote the wrong decision variable (My decision variable contain "optional".)

    "dvar assign interval [j in agents, ie in days, m in shifts] optional in the start [m] .. (start [m] + duration [m]) size duration [m]"

    I have looked at the page and the concepts Intensity and size and forbidden values on the CP Optimizer reference manual.

    But i could not apply these functions to my model.

    I am writing as a constraint for dayoff (Because, I consider dayoffs of each agent (greater than equal to 1 day) for each 7 day weekly planning period. ):

    "forall (j in agents) sum (i in days, m in shifts) presenceOf (assign [j][i][m])<=(Nbday-1)"

    But there are conflicts in solution.

    Must I write the decision variables as follows?:

    dvar interval assign[j in agents, i in days, m in shifts] optional in start[m]..(start[m]+duration[m]) size duration[m] intensity F[j][i][m];

    and stepfunction?:

    stepFunction F[j in agents, i in days, m in shifts] = stepwise { 0->Nbday; 100};

    where/how should I use forbidextent function?

    I would be glad, if you may help me to solve.

    Your sincerely,


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: dayoff on workforce scheduling problem

    Posted Wed December 02, 2015 08:12 AM

    Originally posted by: expir55


    Additional information:

    In my case's model decides on which agent is dayoff in which day (it is unknown that which agent is dayoff in which day).

    It means my model have any data as follows:

    "{Vacation} Vacations[employees] = ...;"

    How can i use this function (forbidExtent(x, F))?

    How can i write stepFunction?

    I would be glad, if you may help me to solve.

    Your sincerely,


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: dayoff on workforce scheduling problem

    Posted Wed December 02, 2015 09:56 AM

    Originally posted by: GGR


    Hi

     

    If I understand you, you problem is about resource timetabling. The schedule of the task being here to assure the feasibility of the timetabling. The right model depends upon how the task modeling.

     

    Note I suppose when you say day-off, the worker does not actually work for all the day. In other word you.

    I have realized that your alternative for task is indexed by the day. Does it means your time is discretized with a one day time unit for the task also. This would mean that the problem is rather a packing one and you should use a Mixed Integer Model.

    If the time for operation cannot not be  discretized that means other constraints holds on or between tasks that cannot be told within a daily time unit. In practice we need the kind of constraints and objective on task to design the right model. For example it is not sure the alternative of day is required.

     

    Hope that helps

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 6.  Re: dayoff on workforce scheduling problem

    Posted Fri December 04, 2015 08:52 AM

    Originally posted by: expir55


    Hi,

     

    Thank you for your interest.

     

    Model gave a solution when i added  followings code to model:

     

    "stepFunction Fassign[j in agents,i in days,m in shifts] = stepwise {0->start[m];100->(start[m]+duration[m]);0};"

     

    "dvar interval assign[j in agents, i in days, m in shifts] optional in start[m]..(start[m]+duration[m]) size duration[m] intensity Fassign[j][i][m];"

     

    Constraint:

    forall(j in agents,i in days, m in shifts) forbidExtent(assign [j][i][m], Fassign[j][i][m]);

     

    Thank you again.

     

    Your sincerely,


    #DecisionOptimization
    #OPLusingCPOptimizer