// file: flights.rex // purpose: Example of airline flights information structure /* This information structure contains 3 main kinds of structure: (1) Flights from one airport to another (2) All flights from one airport, along with the name of the destination airport. (3) All flights, along with the name of the source airport One example of each type: (1) Flights from one airport to another Flights from Las Vegas to St. Louis LAStoSTL = [ [1027, [06, 55], [13, 15]], [366, [09, 30], [15, 25]], [879, [09, 40], [16, 05]], [504, [13, 20], [20, 20]], [1657, [14, 15], [20, 35]], [1201, [18, 00], [00, 05]] ]; (2) All flights from one airport, along with the name of the destination airport Flights from ONT fromONT = [ ["SJC", ONTtoSJC], ["SMF", ONTtoSMF], ["STL", ONTtoSTL], ["TUS", ONTtoTUS] ]; (3) All flights, along with the name of the source airport flights = [ ["LAS", fromLAS], ["OAK", fromOAK], ["OKC", fromOKC], ["ONT", fromONT], ["PHX", fromPHX], ["SJC", fromSJC], ["STL", fromSTL] */ // Flights from one airport to another are lists of elements of the form: // // [flight number, departure time, arrival time] // // where times are of the form [hours, minutes] // with hours in military time. // Flights from Las Vegas to St. Louis LAStoSTL = [ [1027, [06, 55], [13, 15]], [366, [09, 30], [15, 25]], [879, [09, 40], [16, 05]], [504, [13, 20], [20, 20]], [1657, [14, 15], [20, 35]], [1201, [18, 00], [00, 05]] ]; // Flights from Oakland to Phoenix OAKtoPHX = [ [973, [06, 50], [10, 25]], [393, [08, 30], [11, 15]], [694, [09, 50], [13, 30]], [628, [12, 15], [15, 50]], [1395, [13, 25], [16, 10]], [674, [15, 00], [18, 35]], [838, [16, 00], [19, 40]], [545, [16, 20], [19, 55]], [595, [16, 55], [20, 30]], [1718, [17, 00], [20, 40]], [389, [17, 30], [21, 05]], [497, [19, 00], [21, 45]], [391, [20, 00], [23, 30]], [1231, [20, 30], [00, 05]], [1240, [21, 25], [00, 50]] ]; // Flights from Oklahoma City to Phoenix OKCtoPHX = [ [921, [06, 45], [08, 05]], [943, [12, 05], [13, 20]], [923, [16, 15], [17, 30]] ]; // Flights from Oklahoma City to St. Louis OKCtoSTL = [ [528, [09, 40], [11, 00]], [689, [13, 25], [14, 45]], [1620, [18, 40], [20, 55]], [946, [21, 15], [23, 30]] ]; // Flights from Oklahoma City to San Jose OKCtoSJC = [ [921, [06, 45], [10, 15]] ]; // Flights from Ontario to San Jose ONTtoSJC = [ [414, [ 6, 20], [ 7, 30]], [908, [ 8, 15], [ 9, 20]], [1181, [ 9, 35], [10, 40]], [1318, [12, 10], [13, 15]], [936, [14, 50], [15, 55]], [1227, [17, 30], [18, 35]], [1038, [20, 20], [21, 30]] ]; // Flights from Ontario to Sacramento ONTtoSMF = [ [1732, [ 5, 35], [ 6, 50]], [619, [ 6, 30], [ 7, 50]], [991, [ 8, 00], [ 9, 15]], [1710, [ 8, 10], [ 9, 25]], [594, [10, 25], [11, 40]], [927, [12, 00], [13, 15]], [963, [14, 25], [15, 40]], [451, [17, 25], [18, 40]], [785, [19, 00], [20, 15]], [472, [20, 30], [21, 45]], [748, [21, 50], [23, 05]] ]; // Flights from Ontario to St. Louis ONTtoSTL = [ [1201, [16, 25], [00, 05]] ]; // Flights from Ontario to Tucson ONTtoTUS = [ [1090, [13, 30], [16, 50]] ]; // Flights from Phoenix to Houston Hobby (South) PHXtoHOU = [ [123, [07, 35], [11, 00]], [611, [11, 05], [14, 35]], [1257, [13, 15], [16, 40]], [882, [15, 50], [19, 50]], [463, [17, 30], [20, 50]], [983, [19, 05], [22, 25]], [545, [20, 15], [23, 35]], [1247, [21, 40], [00, 55]] ]; // Flights from Phoenix to Oklahoma City PHXtoOKC = [ [689, [10, 10], [13, 05]], [1620, [15, 20], [18, 15]], [781, [21, 25], [00, 20]] ]; // Flights from Phoenix to St. Louis PHXtoSTL = [ [696, [07, 25], [12, 10]], [1471, [07, 25], [12, 10]], [1027, [09, 20], [13, 15]], [1534, [10, 20], [14, 25]], [879, [12, 05], [16, 05]], [1339, [12, 05], [16, 05]], [438, [12, 45], [17, 35]], [1226, [14, 10], [18, 10]], [504, [15, 40], [20, 20]], [1657, [16, 40], [20, 35]], [1201, [20, 20], [00, 05]] ]; // Flights from St. Louis to Phoenix STLtoPHX = [ [796, [07, 55], [11, 15]], [588, [09, 00], [11, 30]], [484, [10, 20], [12, 45]], [765, [10, 20], [12, 45]], [947, [12, 45], [15, 05]], [861, [13, 30], [16, 40]], [1423, [15, 15], [17, 35]], [1273, [16, 20], [18, 40]], [398, [18, 10], [20, 35]], [829, [18, 30], [21, 35]], [857, [18, 40], [21, 05]], [1102, [20, 00], [22, 25]] ]; // Flights from St. Louis to Reno/Tahoe STLtoRNO = [ [1774, [16, 45], [20, 35]] ]; // Flights from St. Louis to Sacramento STLtoSMF = [ [588, [09, 00], [13, 50]] ]; // flights from San Jose to Portland SJCtoPDX = [ [116, [ 7, 30], [ 8, 25]], [310, [12, 30], [14, 15]], [936, [16, 15], [19, 55]], [1793, [20, 30], [22, 10]] ]; // flights from San Jose to Reno SJCtoRNO = [ [1446, [ 7, 30], [ 8, 25]], [125, [ 8, 15], [ 9, 10]], [1181, [11, 00], [11, 50]], [1318, [13, 35], [14, 25]], [548, [14, 55], [15, 45]], [1683, [20, 40], [21, 30]] ]; // Flights from a given airport are lists with each element being a list // // [Destination, List of Flights to Destination] // // flights from LAS fromLAS = [ ["STL", LAStoSTL] ]; // flights from OKC fromOKC = [ ["PHX", OKCtoPHX], ["STL", OKCtoSTL], ["SJC", OKCtoSJC] ]; // flights from OAK fromOAK = [ ["PHX", OAKtoPHX] ]; // flights from ONT fromONT = [ ["SJC", ONTtoSJC], ["SMF", ONTtoSMF], ["STL", ONTtoSTL], ["TUS", ONTtoTUS] ]; // flights from PHX fromPHX = [ ["HOU", PHXtoHOU], ["OKC", PHXtoOKC], ["STL", PHXtoSTL] ]; // flights from SJC fromSJC = [ ["PDX", SJCtoPDX], ["RNO", SJCtoRNO] ]; // flights from STL fromSTL = [ ["PHX", STLtoPHX], ["RNO", STLtoRNO], ["SMF", STLtoSMF] ]; // All flights is a list with each element being of the form // // [Source, List of Flights from Source] // // all flights flights = [ ["LAS", fromLAS], ["OAK", fromOAK], ["OKC", fromOKC], ["ONT", fromONT], ["PHX", fromPHX], ["SJC", fromSJC], ["STL", fromSTL] ];