I am currently using a cp-sat solver from google or-tools in python.
I am using it to plan tasks in a schedule and to affect people to this task. So my variables are tasks that require a set of skills, they can go from 1 to 14 (14 half-days in the week) and I have a list of people with their skills (a dictionnary where each key is a name and each value is a skill).
I have a bunch of tasks that require some skills, for exemple a task can be “making food for kids” so it is associated with the skills “being a cook” and “being comfortable with children”.
I want my code to only plan this task if I have at least one person having the skill “being a cook” and another person having the skill “being comfortable with children”. My code should plan the tasks throughout the week by picking the right timings where there is people that have skills to do the tasks. So it should not plan three tasks requiring the same skill the thursday if I have only two people having this skill at this time, it should only plan two and look for another moment for the third one.
However, I have a lot of trouble understanding how to make my code work.
I was thinking I need new variables that are the people affected to the tasks and force those variables to have the same value as the tasks but haven’t succedeed to make it work.
Does anyone have a idea of how to manage the assignment to people to a task ? (Sorry for the lack of clues on how to do it but I’m struggling to understand)