Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Optional Task Binding to Calendar

  • 1.  Optional Task Binding to Calendar

    Posted 07/13/16 10:52 PM

    Originally posted by: Kyle_Wang


    Hi Dear expert

       please kindly help with my question below:

    Problem:

       i have 7 group of people work on a set of tasks.  7 group of people have different calendar , 

    INumToNumStepFunction[] team_calendar = new INumToNumStepFunction[7];
                for (int i = 0; i < 7; i++)
                {
                    team_calendar[i] = cp.NumToNumStepFunction();
                    team_calendar[i].SetValue(0, 10 * 24, 100);
    
                }
    

       each of the task has head count requirement and time requirement. foreach of the task i need to choose cadidate to finish the task.  here i want to consult you , how to bind the task to calendar. since only the selected task in alttasks list need to 100% take the resource of people.  thanks!

    IIntervalVar pm = cp.IntervalVar(cost,name);
                    alltask[pm_count] = pm;
                    List<IIntervalVar> alttasks = new List<IIntervalVar>();
                    for (int i = 0; i < es_list.Rows.Count; i++)
                    {
                        if(HasSkill(i,module_id))
                        {
                            Console.WriteLine("ES " + i + " " + "has skill to do pm on module " + module);
                            name = entity + "_" + evt + "_"+esname[i];
                            IIntervalVar es_pm = cp.IntervalVar(cost, name);
                            es_pm.SetOptional();
                            alttasks.Add(es_pm);
                            pm_es_matrix[pm_count, i] = es_pm;
                            all_task.Add(es_pm);
                            workerTasks[i].Add(es_pm);
                            TasksWorkers[pm_count].Add(es_pm);
    
                        }
                        
                         
                    }
                    cp.Add(cp.Alternative(pm, alttasks.ToArray()));
    

     


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Optional Task Binding to Calendar

    Posted 07/19/16 12:34 PM

    Originally posted by: ChrisBr


    Hello,

    I'm not sure to understand what you are trying to implement.

    In case this could help, I suggest you to try something such:

    es_pm.SetIntensity(team_calendar[i], 100);
    cp.Add(cp.ForbidStart(es_pm, team_calendar[i]));
    cp.Add(cp.ForbidEnd(es_pm, team_calendar[i]));
    

    See

    SetIntensity,

    ForbidStart,

    ForbidEnd.

    I hope this helps,

    Chris.


    #CPOptimizer
    #DecisionOptimization