Freelance project: Scenario A new startup airline is needing help with ...


Here is the list of freelance projects you can submit new project for free

Python: Programmatically Creating and Optimizing an Airline Schedule
date: 26.09.2017
name:Punj Prakash
description:
Scenario
A new startup airline is needing help with creating and optimizing a flight schedule. They have hired you as a data scientist to create and optimize a flight schedule. The airlines will be all business class and cater to business travel. All aircraft are configured exactly the same and can fly any route in the system interchangeably. The airline will serve Dallas Love Field (DAL), Austin Bergstrom (AUS), and Houston Hobby (HOU).
Aircraft and Tail Numbers
We have leased 6 aircraft. For sake of simplicity, we will assume all aircraft are configured exactly the same and can fly any route in the system and we will assume the “tail numbers” are as follows:
Aircraft “Tail Numbers”
T1
T2
T3
T4
T5
T6
Military Time and Minutes Since Midnight Calculations
All of the airports are on the same time zone. We will use a 4 digit military time format to represent times, with examples as shown below. Hint: for calculations involving time, it will be helpful to use an epoch of midnight and calculate the minutes since midnight = (hour * 60) + minutes, but the flight schedule should be printed in military time. To convert minutes since midnight to military time, hour = minutes since midnight div 60, minutes = minutes since midnight mod 60.
Civilian Time
Military Time
Minutes Since Midnight
6:00 am
0600
(6 * 60) + 0 = 360
7:21 am
0721
(7 * 60) + 21 = 441
11:59 am
1159
(11 * 60) + 59 = 719
12:00 noon
1200
(12 * 60) + 0 = 720
1:28 pm
1338
(13 * 60) + 38 = 818
2:24 pm
1424
(14 * 60) + 24 = 864
10:00 pm
2200
(22 * 60) + 0 = 1320


Noise Restrictions on First Departure and Last Arrival Times
Due to noise restrictions:
• flights cannot have a departure time of 0559 or earlier
• flights can have a departure time of exactly 0600
• flights can have an arrival time of exactly 2200
• flights cannot have an arrival time of 2201 or later

Flight Times (must be exact)
Flight Times are as follows (assume same flight time either direction, presented in “half alpha” order). Flights
must be scheduled for exactly their flight time (no more, no less).
Airport Airport Flight Time in Minutes
AUS DAL 50
AUS HOU 45
DAL HOU 65


Calculating Arrival Times
To calculate an arrival time for the schedule, use the following formula:
arrival time (minutes since midnight) = departure time (minutes since midnight) + flight time (minutes)
Example:
T1,DAL,AUS,0721,0811
departure time = 0721 = (7 * 60) + 21 = 441 minutes since midnight
arrival time = 441 minutes since midnight + 50 minutes = 491 minutes since midnight
491 div 60 = 8
491 mod 60 = 11
arrival time = 0811 military time


Number of Gates and Minimum Ground Time at Airports
We have secured gates at all airports. Each airport has a minimum ground time as follows. These are
minimum times. Aircraft may be on the ground longer if designed.
Airport Number of Gates Minimum Ground Time in Minutes
AUS 1 25
DAL 2 30
HOU 3 35

Calculating Minimum Departure Times
(respecting the minimum ground times)
To calculate minimum departure time, use the following formula:
minimum departure time = arrival time (minutes since midnight) + minimum ground time (minutes)
example:
T1,DAL,AUS,0721,0811
T1,AUS,HOU,0836,0921
Arrival time = 0811 = (8 * 60) + 11 = 491 minutes since midnight
minimum departure time = 491 + 25 minutes = 516 minutes since midnight
516 div 60 = 8
516 mod 60 = 36
minimum departure time = 0836



Aircraft Repositioning for the Next Day
The schedule must start and end with the number of aircraft at an airport equal to the number of gates. It does not matter which specific tail number as all aircraft are configured the same, interchangeable, and may fly any route.


Restrictions on the Number of Aircraft on the Ground at an Airport at the Same Time
No airport may ever have more aircraft on the ground than the number of gates. An aircraft is considered on the ground from the arrival time (inclusive) until departure time (inclusive).
example:
T1,DAL,AUS,0721,0811
T1,AUS,HOU,0836,0921
In this example, T1 is on the ground in AUS from 0811 (inclusive) until 0836 (inclusive)
Since AUS has 1 gate, no aircraft can land with an arrival time during this period
A prior flight with a departure time of 0810 is permitted
A prior flight with a departure time of 0811 is not permitted
Another flight with an arrival time of 0836 is not permitted
Another flight with an arrival time of 0837 is permitted


Optimization Goals
Our optimization goals are to maximize the number of flights, utilize aircraft as evenly as possible, and utilize gates at airports as evenly as possible, and distribute flights among all 6 markets.



No other constraints should be considered
This is a programming lab, so the constraints have been simplified. No other constraints should be considered.
Individual Assignment
This assignment in an individual assignment. You may consult with other student about general approaches to solving the problem and for asking for help to resolve stack traces, but all coding must be your own work. An electronic comparison for similarities in submissions will be made. Any similarities greater than 70% will be investigated by the instructor, with possible referrals for academic dishonesty.


Python Program
You will write a single file Python program in Jupyter Notebook format named create_flight_schedule.ipynb to accomplish them. The input data from the charts above may be hard coded into Python data structures. No input files will be required. The program must run successfully and create an output file flight_schedule.csv.


Your Python code must be algorithmic in nature
Your Python code must be algorithmic in nature. Hardcoding output statements that are not algorithmic in nature is considered cheating and is explicitly listed as an act of academic dishonesty in UTD official regulations, with possible referrals for academic dishonesty.


Documentation Strings and Ratio of Source Code to Comments
In your Python code all functions, classes, and methods should have a documentation string with at least 1 line of meaningful documentation. The ratio of non-empty source code lines to comments should be no more than 5 to 1.


Format of the flight_schedule.csv output file
The flight_schedule.csv file should be created in the local directory. Do not use any directory path.
Below is an example of a snipped of a flight_schedule.csv file. Note there are no spaces and no enclosure quotation marks. All tail numbers and airport codes should be in upper case only. Times should be printed in military time and always 4 digits. It should be sorted in the following order: tail_number, then within tail_number by departure_time.
tail_number,origin,destination,departure_time,arrival_time
T1,DAL,AUS,0600,0650
T1,AUS,HOU,0715,0800
T2,DAL,HOU,0600,0705
T2,HOU,DAL,0740,0845


Submission to eLearning
You must submit to eLearning 2 files:
• create_flight_schedule.ipynb
• flight_schedule.csv

HInts:

tails = ['T1','T2','T3','T4','T5','T6']tails = [1,2,3,4,5,6]
airports = ['AUS','DAL','HOU']
flight_times = [ ['AUS','DAL',50], ...flight_times = { ('AUS','DAL'):50, ...flight_times = { 'AUSDAL':50, ...
flight_times = [ ['AUS','DAL',50], ['DAL','AUS',50] ...flight_time[0][0] would be first one with 'AUS'flight_times = { ('AUS','DAL'):50, ('DAL','AUS'):50, ...flight_times[('AUS','DAL')]flight_times = { 'AUSDAL':50, 'DALAUS':50, ...flight_time['AUSDAL']
gates = [ ['AUS',1], ['DAL',2]...gates = [ ['AUS',1], ['DAL',1], ['DAL',2]...gates = [ ['AUS', [['AUS',1]], 'DAL', [['DAL',1],['DAL',2]], ...
gates = ['AUS1','DAL1','DAL2',...
ground_time = {'AUS':25, 'DAL':30, 'HOU':35 }

x = 600str(x).zfill(4)0600
flight_schedule = []flight_schedule = [ ['T1','DAL','HOU','0600', 360, '0650', xxx], ['T1','AUS','HOU','0715', xxxx, '0800', xxxx], ... ]for flight in flight_schedule:
print(flight[0],flight[1],...

The problem can be solved using basic Python data structures (lists, tuples, dictionaries, sets), if's, looping, functions. No need anything else like classes, external libraries, algorithms from internet, etc.

1) design data structures (hard coding ok)

2) initial flights at 6am (hard coding ok)

3) algorithm (no hard coding) to keep flying flights

3a) flight time exact

3b) ground time minimum, add to it

3c) vary ground time, vary where I fly to, to fly flights again

3d) repeat, stop tail when the tail cannot land before 11pm, stop algorithm when no tail can land before 11pm

4) create output file and write flights to it
email:
budget:$100 - $150

 Regiter as Freelance Developer
Display your skills and contact details on a public profile and receive new freelance project requests by email

 Submit a project request for free !
If you're looking for skilled freelance developer, to complete a freelance project for you
you can contact all of the listed freelancers by this form.


 Work on open freelance projects
Choose a submitted project and contact the author

 List of all freelance developers
Shows the list of developers available to work on your projects.

Search:



This website uses cookies to ensure you get the best experience on our website. Learn More.

Got It!