Skip to content

Scenario 3: Day-of-Ops Disruption Recovery

On the day of operation, weather events or mechanical failures often delay flights. When a flight is delayed, the crew's scheduled sit time shrinks. If it shrinks below the legal minimum, the pairing is "broken" and the optimizer must find a legal recovery solution in real-time.


📌 The Scenario

Background: Snow in Oslo delays a morning departure. The crew has a tight connection in Bergen. If the connection time drops below 30 minutes, they cannot legally operate the next flight.

The Requirements:

  1. Dynamically calculate the actual sit time using estimated arrival/departure times rather than scheduled times.
  2. Flag the connection as illegal if it drops below the absolute minimum.

💻 The Rave Solution

// ====================================================================
// MODULE: Day-of-Ops Tracking - Dynamic Sit Times
// ====================================================================

CONSTANTS:
  %absolute_min_connection% = 00:30;
ENDCONSTANTS

// 1. Use Estimated times instead of Scheduled times
// The solver dynamically updates these keywords during the day of operation
%actual_arrival% = 
  if leg.%has_actual_arrival% then 
    leg.%actual_arrival_time% 
  else 
    leg.%estimated_arrival_time%;

%actual_departure% = 
  if leg.%has_actual_departure% then 
    leg.%actual_departure_time% 
  else 
    leg.%estimated_departure_time%;

// 2. Calculate the dynamic sit time for consecutive legs
CONSTRAINT dynamic_sit_time_check OF Duty
  COMMENT: "Real-time connection must not drop below 30 minutes."
  STATUS: ON;
  RULE:
    for each f1 -> f2 in elements
      f2.%actual_departure% - f1.%actual_arrival% >= %absolute_min_connection%;
ENDCONSTRAINT

🧠 Developer Notes:

  • Dynamic Keywords: In day-of-ops tracking, keywords represent live data streams (e.g., leg.%estimated_arrival_time%). Rave developers must write fail-safes using if/else checks to use the best available data source at any given second.