features/flight_committees.feature in flight-0.0.14 vs features/flight_committees.feature in flight-0.0.16
- old
+ new
@@ -1,20 +1,252 @@
Feature: Flight Committee Calculations
The flight model should generate correct committee calculations
- Scenario Outline: Standard Calculations for origin/destination airport, airline, and craft
- Given a flight has "origin_airport.iata_code" of "<source>"
- And it has "destination_airport.iata_code" of "<dest>"
- And it has "airline.iata_code" of "<airline>"
- And it has "date" of "<date>"
- And it used "aircraft.icao_code" "<aircraft>"
- When emissions are calculated
- Then the fuel committee should be close to <fuel>, +/-1
- And the fuel_per_segment committee should be close to <fuel_per_segment>, +/-10
- And the adjusted_distance_per_segment committee should be close to <adjusted_distance_per_segment>, +/-1
- And the load_factor committee should be close to <load_factor>, +/-0.001
- And the passengers committee should be exactly <passengers>
- And the adjusted_distance committee should be close to <adjusted_distance>, +/-1
+ Scenario: Cohort committee from t100 with usable characteristics
+ Given a flight emitter
+ And a characteristic "origin_airport.iata_code" of "DTW"
+ When the "cohort" committee is calculated
+ Then the conclusion of the committee should have a record with "count" equal to "34"
+
+ Scenario: Cohort committee from t100 with no usable characteristics
+ Given a flight emitter
+ And a characteristic "seat_class.name" of "business"
+ When the "cohort" committee is calculated
+ Then the conclusion of the committee should be nil
+
+ Scenario Outline: Date committee from timeframe
+ Given a flight emitter
+ And a characteristic "timeframe" of "<timeframe>"
+ When the "date" committee is calculated
+ Then the committee should have used quorum "from timeframe"
+ And the conclusion of the committee should be "<from>"
Examples:
- | source | dest | airline | date | aircraft | fuel | fuel_per_segment | adjusted_distance_per_segment | load_factor | passengers | adjusted_distance |
- | DTW | SFO | UA | 2010-06-25 | A320 | 24676 | 7612 | 1341 | 0.788 | 118 | 2241 |
- | IAD | CDG | AF | 2010-06-25 | A320 | 43477 | 13413 | 2492 | 0.800 | 120 | 4161 |
+ | timeframe | from |
+ | 2010-07-15/2010-07-20 | 2010-07-15 |
+
+ Scenario Outline: Date committee from nil timeframe
+ Given a flight emitter
+ And a characteristic "timeframe" of "<timeframe>"
+ When the "date" committee is calculated
+ Then the conclusion of the committee should be "<from>"
+ Examples:
+ | timeframe | from |
+ | | |
+
+ Scenario Outline: Date committee from creation date
+ Given a flight emitter
+ And a characteristic "creation_date" of "<creation_date>"
+ When the "date" committee is calculated
+ Then the committee should have used quorum "from creation date"
+ And the conclusion of the committee should be "<date>"
+ Examples:
+ | creation_date | date |
+ | 2010-07-15 | 2010-07-15 |
+
+ Scenario Outline: Seat class multiplier committee from seat class
+ Given a flight emitter
+ And a characteristic "seat_class.name" of "<seat_class>"
+ When the "seat_class_multiplier" committee is calculated
+ Then the committee should have used quorum "from seat class"
+ And the conclusion of the committee should be "<multiplier>"
+ Examples:
+ | seat_class | multiplier |
+ | business | 1.69 |
+ | economy | 0.94 |
+ | first | 1.47 |
+
+ Scenario: Seat class multiplier committee from default
+ Given a flight emitter
+ When the "seat_class_multiplier" committee is calculated
+ Then the committee should have used quorum "default"
+ And the conclusion of the committee should be "1.0"
+
+ Scenario Outline: Domesticity committee from airline for domestic airlines
+ Given a flight emitter
+ And a characteristic "airline.name" of "<airline>"
+ When the "domesticity" committee is calculated
+ Then the committee should have used quorum "from airline"
+ And the conclusion of the committee should have a record with "name" equal to "<domesticity>"
+ Examples:
+ | airline | domesticity |
+ | Midwest Aviation | Domestic Data, US Carriers Only |
+
+ Scenario Outline: Domesticity committee from airline for international airlines
+ Given a flight emitter
+ And a characteristic "airline.name" of "<airline>"
+ When the "domesticity" committee is calculated
+ Then the conclusion of the committee should be nil
+ Examples:
+ | airline |
+ | Aeroflot |
+ | United Airlines |
+
+ Scenario Outline: Domesticity committee from destination airport for domestic airports
+ Given a flight emitter
+ And a characteristic "destination_airport.iata_code" of "<iata_code>"
+ When the "domesticity" committee is calculated
+ Then the committee should have used quorum "from destination"
+ And the conclusion of the committee should have a record with "name" equal to "<domesticity>"
+ Examples:
+ | iata_code | domesticity |
+ | ALO | Domestic Data, US Carriers Only |
+ | TXK | Domestic Data, US Carriers Only |
+
+ Scenario Outline: Domesticity committee from destination airport for international airports
+ Given a flight emitter
+ And a characteristic "destination_airport.iata_code" of "<iata_code>"
+ When the "domesticity" committee is calculated
+ Then the conclusion of the committee should be nil
+ Examples:
+ | iata_code |
+ | DTW |
+ | IAD |
+ | GRR |
+
+ Scenario Outline: Domesticity committee from origin airport for domestic airports
+ Given a flight emitter
+ And a characteristic "origin_airport.iata_code" of "<iata_code>"
+ When the "domesticity" committee is calculated
+ Then the committee should have used quorum "from origin"
+ And the conclusion of the committee should have a record with "name" equal to "<domesticity>"
+ Examples:
+ | iata_code | domesticity |
+ | ALO | Domestic Data, US Carriers Only |
+ | TXK | Domestic Data, US Carriers Only |
+
+ Scenario Outline: Domesticity committee from destination for international airports
+ Given a flight emitter
+ And a characteristic "destination_airport.iata_code" of "<iata_code>"
+ When the "domesticity" committee is calculated
+ Then the conclusion of the committee should be nil
+ Examples:
+ | iata_code |
+ | DTW |
+ | IAD |
+ | GRR |
+
+ Scenario Outline: Domesticity committee from airports for domestic route
+ Given a flight emitter
+ And a characteristic "origin_airport.iata_code" of "<origin>"
+ And a characteristic "destination_airport.iata_code" of "<destination>"
+ When the "domesticity" committee is calculated
+ Then the committee should have used quorum "from origin"
+ And the conclusion of the committee should have a record with "name" equal to "<domesticity>"
+ Examples:
+ | origin | destination | domesticity |
+ | DTW | SFO | Domestic Data, US Carriers Only |
+
+ Scenario Outline: Domesticity committee from airports for international route
+ Given a flight emitter
+ And a characteristic "origin_airport.iata_code" of "<origin>"
+ And a characteristic "destination_airport.iata_code" of "<destination>"
+ When the "domesticity" committee is calculated
+ Then the conclusion of the committee should be nil
+ Examples:
+ | origin | destination |
+ | DTW | CDG |
+
+ Scenario: Trips committee
+ Given a flight emitter
+ When the "trips" committee is calculated
+ Then the conclusion of the committee should be "1.941"
+
+ Scenario: Freight share committee from cohort
+ Given a flight emitter
+ And a characteristic "origin_airport.iata_code" of "DTW"
+ When the "cohort" committee is calculated
+ And the "freight_share" committee is calculated
+ Then the committee should have used quorum "from cohort"
+ And the conclusion of the committee should be "0.11876"
+
+ Scenario: Fuel type committee from default
+ Given a flight emitter
+ When the "fuel_type" committee is calculated
+ Then the conclusion of the committee should have a record with "emission_factor" equal to "2.527139"
+
+ Scenario Outline: Emission factor committee
+ Given a flight emitter
+ And pending - no fuel type records yet
+
+ Scenario Outline: Radiative forcing index committee
+ Given a flight emitter
+ And pending - no fuel type records yet
+
+ Scenario Outline: Radiative forcing index committee
+ Given a flight emitter
+ And pending - no fuel type records yet
+
+ Scenario: Emplanements per trip committee from default
+ Given a flight emitter
+ When the "emplanements_per_trip" committee is calculated
+ Then the conclusion of the committee should be "1.67"
+
+ Scenario: Distance committee from default
+ Given a flight emitter
+ When the "distance" committee is calculated
+ Then the committee should have used quorum "default"
+ And the conclusion of the committee should be "1121.73083"
+
+ Scenario Outline: Distance committee from cohort
+ Given a flight emitter
+ And a characteristic "origin_airport.iata_code" of "<origin>"
+ And a characteristic "destination_airport.iata_code" of "<destination>"
+ And a characteristic "aircraft.icao_code" of "<craft>"
+ And a characteristic "airline.iata_code" of "<airline>"
+ And a characteristic "propulsion.name" of "<propulsion>"
+ And a characteristic "domesticity.name" of "<domesticity>"
+ When the "cohort" committee is calculated
+ And the "distance" committee is calculated
+ Then the committee should have used quorum "from cohort"
+ And the conclusion of the committee should be "<distance>"
+ Examples:
+ | origin | destination | craft | airline | propulsion | domesticity | distance |
+ | DTW | | A320 | UA | | Domestic Data, US Carriers Only | 325 |
+
+ Scenario Outline: Distance committee from distance class
+ Given a flight emitter
+ And a characteristic "distance_class.name" of "<distance_class>"
+ When the "distance" committee is calculated
+ Then the committee should have used quorum "from distance class"
+ And the conclusion of the committee should be "<distance>"
+ Examples:
+ | distance_class | distance |
+ | epic | 8689.74081 |
+ | long | 2606.92764 |
+ | medium | 868.97408 |
+ | short | 217.24406 |
+
+ Scenario Outline: Distance committee from distance estimate
+ Given a flight emitter
+ And a characteristic "distance_estimate" of "<distance_estimate>"
+ When the "distance" committee is calculated
+ Then the committee should have used quorum "from distance estimate"
+ And the conclusion of the committee should be "<distance>"
+ Examples:
+ | distance_estimate | distance |
+ | 123 | 66.41468 |
+
+ Scenario Outline: Distance committee from airports
+ Given a flight emitter
+ And a characteristic "origin_airport.iata_code" of "<origin>"
+ And a characteristic "destination_airport.iata_code" of "<destination>"
+ When the "distance" committee is calculated
+ Then the committee should have used quorum "from airports"
+ And the conclusion of the committee should be "<distance>"
+ Examples:
+ | origin | destination | distance |
+ | DTW | SFO | 1803.65517 |
+ | IAD | DCA | 20.32743 |
+ | MSP | FRA | 3809.26855 |
+
+ Scenario Outline: Adjusted distance committee from distance
+ Given a flight emitter
+ And a characteristic "distance_estimate" of "<distance_estimate>"
+ When the "distance" committee is calculated
+ And the "emplanements_per_trip" committee is calculated
+ And the "adjusted_distance" committee is calculated
+ Then the conclusion of the committee should be "<distance>"
+ Examples:
+ | distance_estimate | distance |
+ | 0 | 0 |
+ | 1 | 0.67092 |
+ | 1254 | 841.33709 |