Hello, I have a homework to handle scheduling related to machines, products, and operators. Currently everything is running well, but there is a new limitation where it turns out that machines can only be used by certain operators or operators can only use certain machines.
Currently I am using heapq to get the operator with the fastest start and end schedule and for machines, I am also using heapq to get machine data with the fastest start and end schedule.
Currently I call the fastest operator, then the fastest machine. But this time it has a limitation that the operator must use the appropriate machine so it can't be arbitrary.
The obstacle is, because currently I call the operator first and then the machine, the machine is not efficient because the first time it must use the machine with CODE 1 - N or: 1, 2, 3 ,4 ,5 ,6, ... n. Just retrieve operator data based on the machine code of the fastest operator, for example if Machine Code 1 is finished and machine code 2 is finished, then use the fastest available.
Automatically in the machine, the starting time and ending time are needed. How to make this machine restriction can be operated by which operator in an efficient and fast way?
In the machine data, the capacity is the length of time the machine operates. For example, the starting hour of the capacity is 7 while the capacity is 8. Then that means the capacity is 8 working hours, so 7 + 8 = 15. Then the machine ends at 15.