Skip to content

6. Cost Modeling & Objective Functions

6.1 Cost Property Definitions

In addition to legality rules, Rave models pairing and roster costs. Every derived activity (Duty, Trip, Roster) defines a special property named cost.

PROPERTY cost OF Trip
  RULE:
    max(
      sum(duty(trip), duty.cost),
      %guaranteed_trip_pay%
    ) + %soft_penalty_total%;
ENDPROPERTY

6.2 Guaranteed Pay & Overtime Structures

Airlines pay crew members based on formulas incorporating flight time, duty elapsed time, layover duty credit (TAFB - Time Away From Base), and minimum daily guarantees:

%duty_pay_flight_time% = sum(leg(duty), leg.%block_time%) * %hourly_rate%;
%duty_pay_elapsed_rig% = duty.%elapsed_time% * 0.50 * %hourly_rate%;
%duty_minimum_guarantee% = 04:00 * %hourly_rate%;

PROPERTY cost OF Duty
  RULE:
    max(
      max(%duty_pay_flight_time%, %duty_pay_elapsed_rig%),
      %duty_minimum_guarantee%
    );
ENDPROPERTY

6.3 Soft Penalty Functions

Soft constraints guide the solver toward desirable solutions by appending penalty weights to the objective function:

%short_layover_penalty% = 
  if %layover_duration% < 12:00 then
    (12:00 - %layover_duration%) * %penalty_weight%
  else
    0.0;