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