0

I'm following https://developers.google.com/optimization/scheduling/employee_scheduling / https://developers.google.com/optimization/scheduling/job_shop in python to help me with a task. [Example problem] I want to add a constraint similar to AddAtMostOne, but I don't want it to be at most 1, I want it to be at most another integer.

In the context of the Job Shop problem linked above, I want to have multiple's of the same machine. For example I want 2 Machine 1's. How would I add as a constraint use up to 2 Machine 1's simultaneously? I haven't added AddExactlyOne as in that tutorial for this reason.

data24
  • 21
  • 2
  • Use Cumulative instead of NoOverlap. – Laurent Perron Apr 04 '23 at 15:31
  • I was looking at Cumulative but wasn't sure how to define demands. Capacity would be 2 Machine 1's in this example, for a specified interval, but what would the demand be? I'm assuming it must be <= capacity, but unsure how to define it. – data24 Apr 04 '23 at 16:15
  • I would suggest a demand of 1 – Laurent Perron Apr 04 '23 at 17:10
  • Note: AtMostOne is a constraint on Boolean literals. Not really appropriate for jobshops – Laurent Perron Apr 04 '23 at 17:20
  • Thank you for your help, I will try demand of 1. I was also considering using AddNoOverlap, but then I'd need to create ids for each sub-machine that is Machine 1. That might be easier as I will need to add no overlaps as well – data24 Apr 04 '23 at 17:25

0 Answers0