You can add the constraints startBeforeStart(total_pieces, wp1_pieces), startBeforeStart(total_pieces, wp2_pieces), endBeforeEnd(wp1_pieces, total_pieces) and endBeforeEnd(wp2_pieces, total_pieces). That ensures that the total_pieces interval covers both of the other intervals. It does not ensure that the fit is tight (no slack in the total_pieces interval), but if you are minimizing makespan then the solver will not overestimate the end time of total_pieces (it might conceivably underestimate the start time).
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
------------------------------
Original Message:
Sent: Sat June 01, 2024 09:00 PM
From: Mohamed Awad
Subject: How to append two decision intervals?
The two intervals can overlap but there is no information on which interval starts or ends before the other
------------------------------
Mohamed Awad
Original Message:
Sent: Sat June 01, 2024 04:12 PM
From: Paul Rubin
Subject: How to append two decision intervals?
Are the first two intervals allowed to overlap, and do you know in advance which starts first and which ends first?
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
Original Message:
Sent: Sat June 01, 2024 03:36 PM
From: Mohamed Awad
Subject: How to append two decision intervals?
Hi,
I have two decision intervals "wp1_pieces & wp2_pieces"and I would like to combine them into a new decision variable "total_pieces". Is that possible?.
Here is how the two decision intervals look like
dvar interval wp1_pieces[a in allActivities][b in St][1..maxPieces] optional size 100;
dvar interval wp2_pieces[a in allActivities][b in St][1..maxPieces] optional size 200;
After the dvar interval total_pieces is made by combining the two intervals, I would like to minimise the makespan based on that interval:
dexpr float makespan = max(a in allActivities,b in St,j in 1..maxPieces) endOf(total_pieces[a][b][j]);
Thanks,
Mohamed
------------------------------
Mohamed Awad
------------------------------