0

I am trying to solve a production scheduling problem in Ortools. The problem contains parallel machines. I have created a variable called all_task just like in standard example at https://developers.google.com/optimization/scheduling/job_shop but instead of task id I indexed the variable at machine id

all_tasks[job_id, machine_id] = task_type(start=start_var, end=end_var, interval=interval_var)

Now while creating constraint, I want the sum of interval(production duration) in all machines for a single job should be equal to the total interval required for the job. How do I do it in ortools? In Pulp package i can create a for loop of jobs and then again create for iterator inside the lpsum function inside the first for loop.

Swastik
  • 101
  • 9
  • Can you define `single job sum of interval of all machines put together` ? – Laurent Perron Aug 25 '20 at 07:25
  • If a job is run on two parallel machines, the sum of duration in each machine should be equal to the total time required for job completion. – Swastik Aug 25 '20 at 15:24
  • That part should be easy. Replace the constant duration by a variable duration between 0 and max duration. I would add the two implications: `interval_is_performed implies duration > 0` and `interval_is_performed.Not() implies duration == 0`. Then `sum(durations) == total_duration`. Do you need some kind of synchronisation between shared tasks across machines ? – Laurent Perron Aug 25 '20 at 16:30
  • Thanks Laurent, but I think I would still have to sum `durations` over all machines for a single job. Here is my complete code to give you more idea, can you guide me on how to implement it. [https://colab.research.google.com/github/mswastik/optimization/blob/master/CP.ipynb](https://colab.research.google.com/github/mswastik/optimization/blob/master/CP.ipynb) – Swastik Aug 26 '20 at 15:21

0 Answers0