need to write a temporal constraint

14 views
Skip to first unread message

mohamed mady

unread,
Mar 25, 2023, 6:08:00 PM3/25/23
to AMPL Modeling Language
Hi all,
I have some troubling with the following problem:
I have a set of aircraft and i need to construct intervals which contains the overlapped aircraft, such intervals are defined starting from an array like ad:=[9,9:30,10,11,14,15] where each adjacent pairs form an interval, and this interval is formed by two vectors, one of departure time and one of arrival time, so, we have:

set F:= flight1 flight2 flight3;
param a{i in F}; # arrival time of the flights
a{i in F}:=      
flight1 9
flight2 10
flight3 11;
param d{i in F}; # departure time of the flights
a{i in F}:=      
flight1 9:30
flight2 15
flight3 14;

the first thing i need is to union the two array, meanig a and d, in a new vector, ad, such that the vector is ordered in ascending order.
the second step is once i have the new array ad, i need to define intervals, like:
I1 that has extreme time 9 and 9:30, I2 that has extreme time 9:30 and 10 and so on.
Next step i need to make a condition such that if that condition is true that the i-th flight,Fi, need to be in the j-th interval, Ij.
Once a have all interval i need only to keep intervals with more than one element.

thank you for the attention

AMPL Google Group

unread,
Mar 27, 2023, 1:28:21 PM3/27/23
to AMPL Modeling Language
For some of the concepts you descripbe, it would be very helpful to have more explanation:

need to make a condition


--
Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
{#HS:2194681319-115367#}
Reply all
Reply to author
Forward
0 new messages