Decide if a Courtenay Landing is Safe
Breaking it down:
- Wind warning in Courtenay
- Wind speed > 12 knot = unsafe to land
- Alt Landing Location is 30 min drive to Courtenay (irrelevant data)
- Purpose: Notify in the event of dangerous wind speed to make alt travel plans.
I would want to create a loop/watcher that triggers an event if the safe-to-land wind speed threshold is exceeded.
We would then want to send notifications to the user, set the new destination (the default landing strip), and notify new destination to book the user a rental/loaner car for the expected arrival time.
Pseudo code
Variables:
user = {}; // an object which stores the users information
flight = { // object storing relevant flight information
“destination” = “Courtenay”, // flight destination
“arrival” = arrivalTime, // flight arrival time
“default” = “Smits Field”, // default flight landing destination
“thresh” = 12, // wind speed threshold for safe landing
“remainingDuration” = someValue}; // remaining flight duration
currentWindSpeed = null; // for storing the current wind speed
Functions:
getWindSpeed(location)
// gets the current wind speed for the desired location
Main Program:
while (flight.remainingDuration>0)
/* The problem suggests to me that this program will run when the user checks in on this algorithm, but it might be more fun to write a loop that checks every so often whether the wind speed has exceeded the safe value, so that if the threshold is exceeded it diverts the flight and notifies the user. We could also automatically book the rental car from the “Airstrip Marshal” so Louise doesn’t have to. */
if (getWindSpeed(destination) > thresh)
// unsafe to land condition has been met
// notify user – flight rerouted to default
// calculate time when arrival expected
// book rental car from airstrip marshal for calculated arrival time using user{} data
// maybe update flight.destination and other relevant flight details
delay(); // we might not want to send out a billion requests for data per flight, so check every 5 or 10 minutes, maybe.
mwilson
This answers a question but not the question asked. Which airfield do they land in? Smit or Courtenay?
roga
Do I reply to your comments here? I don’t have it in front of me but I gathered that the wind could either be greater or less than the threshold of safety. Depending on that input value when the program looks up the windspeed at the desired destination, the plan would either be to land as intended or reroute to Smit.