Refuel

Inspiration

Boarding your plane late because it hasn't been refueled yet is frustrating. Since nobody likes having their flight delayed, I wanted to both improve the operations of airlines and make fuel agent jobs easier.

I researched how fueling schedules were made, and it's a surprisingly complicated process. Gate changes, late or early flights, having less fuel after particularly bad weather, and unexpected baggage load can all impact how long it takes to refuel a plane. Since plane refueling is done by radio calls to ground crew, I saw an opportunity to optimize the process. Plane Refueling IRL

What it does

You play an optimization game against the agent, with your actions on the left and its actions on the right. You'll experience the stress of managing a refueling schedule when planes are late, grounds operations are suspended, and gates are changed last minute.

By using important plane data such as fuel level, priority level, and variable fuel levels, ground crew location, and random events such as lightning strikes, captains requesting more fuel, and gate changes, a machine learning model learns the optimal strategy for routing fuel trucks while minimizing delays.

The model receives a punishment for late flights and a reward for getting flights fueled on time. Just like the real world, it's run through tons of different simulations to find the overall best strategy, which is then deployed into daily operations.

How I built it

After I researched the relevant factors which go into real life fuel scheduling, I built them as components into the simulation. For example, a slow truck movement speed, fueling rates, different necessary fuel amounts are all taken into account for this simulation.

I initially looked at queuing algorithms to see if this problem was addressable by existing scheduling techniques. However, the amount of changing variables in the simulation led to a rigorous queuing algorithm failing to adapt to changes, such as a pilot requesting more fuel because of a weather change.

I then looked into a heavier ML model using reinforcement learning with policy optimization. This technique was good but actually too slow on my machine and for a task with such an explicit goal (minimizing late flights), it was unnecessary.

I settled on Bayesian optimization, which was lightweight enough to be done in the browser so that everyone could experience competition with the agent locally.

I then created super simple shapes to represent planes and trucks and used an RNG library to create random schedules for the planes, as well as a bunch of different random events throughout the day. Writing some simple animations for truck movement and fuel gauges and user actions for sending fuel trucks made the game actually functional. An early version of the visuals

I spent a while adding all the events into the game and tweaking the number of cars, gates, and fueling rates to make the game feel challenging whilst lining up with realistic timeframes of fueling and driving (30 mins and 10 mins).

I added agent handlers to define what actions the AI agent can take, which are basically the same as the user. I also allowed it to look at all the same data instantly, as fast as it would process in the real world.

Then, I ran training and validation runs to ensure that the optimal policy was general enough for variation in airport operations, while still being better than the others. I compared my manual strategy, and sure enough, the agent won every single time (by a lot).

I quickly made some assets and themed the game slightly, and it was ready to show people why refueling schedules don't have to be so stressful!

Challenges I ran into

There are infinite events that you could add into the game. In a real airport, disruptions and unforeseen circumstance like winter storms happen all the time, but I didn't want to over-represent them and lessen the real impact that the AI could have in a real airport scenario.

Additionally, it's hard to find data on real airport operations. Originally I wanted to simulate this using live data from a busy airport like IAH, but I couldn't find publicly available data on timestamps of refueling or public refueling schedules to base it on, so I had to mock my data randomly.

Accomplishments that I'm proud of

The game really highlights the chaos and difficulty of effectively managing fuel in a busy airport, which is exactly what I wanted users to feel. The job isn't talked about enough and oftentimes, passengers have no visibility into why their planes would be delayed. This simulation definitely shows them the difference machine learning can make in airport operations, while helping them empathize with how difficult the job is.

What I learned

There's a ton of factors which go into why planes can be late, and plane refueling is just one of them. Even inside this one area, the amount of real-world complexity and expertise needed to manage an airport is huge. The next time I'm on a plane that's delayed, I'll remember the feeling of managing 7 late planes at a time with only 3 refueling trucks.

What's next for Refuel

The next logical step is some integration into real world airports. Having a way to just collect data about when planes land, are ready for fuel, and their real fuel needs would elevate this simulation from a toy for learning into a tool for airlines to use in production. In real life, this would also send updates to the ground crew via a phone or tablet, rather than magically following orders from the tower.

Built With

Share this project:

Updates