features/flight_committees.feature in flight-0.1.4 vs features/flight_committees.feature in flight-0.1.5

- old
+ new

@@ -15,30 +15,30 @@ Scenario: Cohort committee for a direct flight from origin Given a flight emitter And a characteristic "segments_per_trip" of "1" And a characteristic "origin_airport.iata_code" of "AIA" When the "cohort" committee is calculated - Then the conclusion of the committee should have a record with "count" equal to "4" + Then the conclusion of the committee should have a record with "count" equal to "3" Scenario: Cohort committee for a direct flight from destination Given a flight emitter And a characteristic "segments_per_trip" of "1" And a characteristic "destination_airport.iata_code" of "WEA" When the "cohort" committee is calculated - Then the conclusion of the committee should have a record with "count" equal to "5" + Then the conclusion of the committee should have a record with "count" equal to "3" Scenario: Cohort committee for a direct flight from aircraft Given a flight emitter And a characteristic "segments_per_trip" of "1" - And a characteristic "aircraft.icao_code" of "FM1" + And a characteristic "aircraft.bp_code" of "BP-FM1" When the "cohort" committee is calculated Then the conclusion of the committee should have a record with "count" equal to "1" Scenario: Cohort committee for a direct flight from airline Given a flight emitter And a characteristic "segments_per_trip" of "1" - And a characteristic "airline.iata_code" of "IA" + And a characteristic "airline.iata_code" of "DA" When the "cohort" committee is calculated Then the conclusion of the committee should have a record with "count" equal to "2" Scenario: Cohort committee for an indirect flight with usable characteristics Given a flight emitter @@ -62,11 +62,11 @@ Then the conclusion of the committee should be nil Scenario: Cohort committee for a direct flight with aircraft that exists but is not in t100 Given a flight emitter And a characteristic "segments_per_trip" of "1" - And a characteristic "aircraft.icao_code" of "XX3" + And a characteristic "aircraft.bp_code" of "BP-XX2" When the "cohort" committee is calculated Then the conclusion of the committee should be nil Scenario: Cohort committee for a direct flight with airline that exists but is not in t100 Given a flight emitter @@ -79,11 +79,11 @@ Given a flight emitter And a characteristic "segments_per_trip" of "1" And a characteristic "origin_airport.iata_code" of "ADA" And a characteristic "destination_airport.iata_code" of "WEA" When the "cohort" committee is calculated - Then the conclusion of the committee should have a record with "count" equal to "1" + Then the conclusion of the committee should have a record with "count" equal to "2" Scenario: Cohort committee for a direct flight with origin that exists but is not in t100 and destination in t100 Given a flight emitter And a characteristic "segments_per_trip" of "1" And a characteristic "origin_airport.iata_code" of "XXX" @@ -96,12 +96,18 @@ And a characteristic "segments_per_trip" of "1" And a characteristic "origin_airport.iata_code" of "AIA" And a characteristic "destination_airport.iata_code" of "XXX" And a characteristic "airline.iata_code" of "IA" When the "cohort" committee is calculated - Then the conclusion of the committee should have a record with "count" equal to "4" + Then the conclusion of the committee should have a record with "count" equal to "3" + Scenario: Aircraft class committee from aircraft + Given a flight emitter + And a characteristic "aircraft.bp_code" of "BP-FM1" + When the "aircraft_class" committee is calculated + Then the conclusion of the committee should have "code" of "EX" + Scenario: Country committee from origin and destination Given a flight emitter And a characteristic "origin_airport.iata_code" of "ADA" And a characteristic "destination_airport.iata_code" of "AIA" When the "country" committee is calculated @@ -113,11 +119,11 @@ When the "country" committee is calculated Then the conclusion of the committee should be nil Scenario: Country committee for international flight Given a flight emitter - And a characteristic "origin_airport.iata_code" of "ADA" + And a characteristic "origin_airport.iata_code" of "AIA" And a characteristic "destination_airport.iata_code" of "WEA" When the "country" committee is calculated Then the conclusion of the committee should be nil Scenario: Seat class multiplier committee from seat class @@ -136,104 +142,92 @@ Scenario: Trips committee from default Given a flight emitter When the "trips" committee is calculated Then the conclusion of the committee should be "1.941" - Scenario Outline: Freight share committee from cohort + Scenario: Freight share committee from cohort Given a flight emitter And a characteristic "segments_per_trip" of "1" - And a characteristic "origin_airport.iata_code" of "<origin>" + And a characteristic "origin_airport.iata_code" of "AIA" 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 "<freight share>" - Examples: - | origin | freight share | - | ADA | 0.0099 | - | AIA | 0.09091 | + And the conclusion of the committee should be "0.06205" Scenario: Freight share committee from default Given a flight emitter When the "freight_share" committee is calculated Then the committee should have used quorum "default" - And the conclusion of the committee should be "0.06391" + And the conclusion of the committee should be "0.04313" - Scenario Outline: Load factor committee from cohort + Scenario: Load factor committee from cohort Given a flight emitter And a characteristic "segments_per_trip" of "1" - And a characteristic "origin_airport.iata_code" of "<origin>" + And a characteristic "origin_airport.iata_code" of "AIA" When the "cohort" committee is calculated And the "load_factor" committee is calculated Then the committee should have used quorum "from cohort" - And the conclusion of the committee should be "<load_factor>" - Examples: - | origin | load_factor | - | ADA | 0.8 | - | AIA | 0.83333 | + And the conclusion of the committee should be "0.81197" Scenario: Load factor committee from default Given a flight emitter When the "load_factor" committee is calculated Then the committee should have used quorum "default" - And the conclusion of the committee should be "0.82222" + And the conclusion of the committee should be "0.81385" Scenario Outline: Seats committee from aircraft with seats Given a flight emitter - And a characteristic "aircraft.icao_code" of "<code>" + And a characteristic "aircraft.bp_code" of "<code>" When the "seats" committee is calculated Then the committee should have used quorum "from aircraft" And the conclusion of the committee should be "<seats>" Examples: - | code | seats | - | FM1 | 125 | - | BA1 | 120 | + | code | seats | + | BP-FM1 | 125.0 | + | BP-BA1 | 120.0 | + | BP-XX1 | 130.0 | Scenario Outline: Seats committee from aircraft missing seats Given a flight emitter - And a characteristic "aircraft.icao_code" of "<code>" + And a characteristic "aircraft.bp_code" of "<code>" When the "seats" committee is calculated Then the committee should have used quorum "default" - And the conclusion of the committee should be "121.6666667" + And the conclusion of the committee should be "123.0" Examples: - | code | - | XX1 | - | XX2 | - | XX3 | - | XX4 | + | code | + | BP-XX2 | + | BP-XX3 | + | BP-XX4 | Scenario: Seats committee from seats estimate Given a flight emitter And a characteristic "seats_estimate" of "100.25" When the "seats" committee is calculated Then the committee should have used quorum "from seats estimate" And the conclusion of the committee should be "100" - Scenario Outline: Seats committee from cohort + Scenario: Seats committee from cohort Given a flight emitter And a characteristic "segments_per_trip" of "1" - And a characteristic "origin_airport.iata_code" of "<origin>" + And a characteristic "origin_airport.iata_code" of "ADA" When the "cohort" committee is calculated And the "seats" committee is calculated Then the committee should have used quorum "from cohort" - And the conclusion of the committee should be "<seats>" - Examples: - | origin | seats | - | ADA | 125 | - | AIA | 120 | + And the conclusion of the committee should be "122.5" Scenario: Seats committee from aircraft class Given a flight emitter - And a characteristic "aircraft_class.brighter_planet_aircraft_class_code" of "EX" + And a characteristic "aircraft_class.code" of "EX" When the "seats" committee is calculated Then the committee should have used quorum "from aircraft class" - And the conclusion of the committee should be "121" + And the conclusion of the committee should be "121.25" Scenario: Seats committee from default Given a flight emitter When the "seats" committee is calculated Then the committee should have used quorum "default" - And the conclusion of the committee should be "121.6666667" + And the conclusion of the committee should be "123.0" Scenario: Passengers committee from seats and load factor Given a flight emitter And a characteristic "seats" of "105" And a characteristic "load_factor" of "0.9" @@ -245,71 +239,93 @@ When the "fuel_type" committee is calculated Then the conclusion of the committee should have "name" of "Jet Fuel" Scenario Outline: Fuel use coefficients committee from aircraft with fuel use coefficients Given a flight emitter - And a characteristic "aircraft.icao_code" of "<code>" + And a characteristic "aircraft.bp_code" of "<code>" When the "fuel_use_coefficients" committee is calculated Then the committee should have used quorum "from aircraft" And the conclusion of the committee should have a record with "m3" equal to "<m3>" And the conclusion of the committee should have a record with "m2" equal to "<m2>" And the conclusion of the committee should have a record with "m1" equal to "<m1>" And the conclusion of the committee should have a record with "endpoint_fuel" equal to "<b>" Examples: - | code | m3 | m2 | m1 | b | - | FM1 | 0 | 0 | 1 | 0 | - | BA1 | 0 | 0 | 2 | 0 | - | XX2 | 0 | 0 | 3 | 0 | - | XX4 | 0 | 0 | 4 | 0 | + | code | m3 | m2 | m1 | b | + | BP-FM1 | 0 | 0 | 1 | 0 | + | BP-BA1 | 0 | 0 | 2 | 0 | + | BP-XX2 | 0 | 0 | 4 | 0 | Scenario Outline: Fuel use coefficients committee from aircraft missing fuel use coefficients Given a flight emitter - And a characteristic "aircraft.icao_code" of "<code>" - When the "fuel_use_coefficients" committee is calculated - Then the committee should have used quorum "default" + And a characteristic "aircraft.bp_code" of "<code>" + When the "aircraft_class" committee is calculated + And the "fuel_use_coefficients" committee is calculated + Then the committee should have used quorum "from aircraft class" And the conclusion of the committee should have a record with "m3" equal to "0" And the conclusion of the committee should have a record with "m2" equal to "0" - And the conclusion of the committee should have a record with "m1" equal to "1.66667" + And the conclusion of the committee should have a record with "m1" equal to "4" And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0" Examples: - | code | - | XX1 | - | XX3 | + | code | + | BP-XX1 | + | BP-XX3 | + | BP-XX4 | Scenario: Fuel use coefficients committee from aircraft class Given a flight emitter - And a characteristic "aircraft_class.brighter_planet_aircraft_class_code" of "EX" + And a characteristic "aircraft_class.code" of "EX" When the "fuel_use_coefficients" committee is calculated Then the committee should have used quorum "from aircraft class" And the conclusion of the committee should have a record with "m3" equal to "0" And the conclusion of the committee should have a record with "m2" equal to "0" - And the conclusion of the committee should have a record with "m1" equal to "1.66667" + And the conclusion of the committee should have a record with "m1" equal to "1.75" And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0" - Scenario Outline: Fuel use coefficients committee from cohort + Scenario: Fuel use coefficients committee from cohort where all aircraft have fuel use equation Given a flight emitter And a characteristic "segments_per_trip" of "1" - And a characteristic "origin_airport.iata_code" of "<origin>" + And a characteristic "origin_airport.iata_code" of "ADA" When the "cohort" committee is calculated And the "fuel_use_coefficients" committee is calculated Then the committee should have used quorum "from cohort" - And the conclusion of the committee should have a record with "m3" equal to "<m3>" - And the conclusion of the committee should have a record with "m2" equal to "<m2>" - And the conclusion of the committee should have a record with "m1" equal to "<m1>" - And the conclusion of the committee should have a record with "endpoint_fuel" equal to "<b>" - Examples: - | origin | m3 | m2 | m1 | b | - | ADA | 0 | 0 | 1 | 0 | - | AIA | 0 | 0 | 2 | 0 | + And the conclusion of the committee should have a record with "m3" equal to "0" + And the conclusion of the committee should have a record with "m2" equal to "0" + And the conclusion of the committee should have a record with "m1" equal to "1.5" + And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0" + Scenario: Fuel use coefficients committee from cohort where some aircraft are missing fuel use equation + Given a flight emitter + And a characteristic "segments_per_trip" of "1" + And a characteristic "origin_airport.iata_code" of "AIA" + When the "cohort" committee is calculated + And the "fuel_use_coefficients" committee is calculated + Then the committee should have used quorum "from cohort" + And the conclusion of the committee should have a record with "m3" equal to "0" + And the conclusion of the committee should have a record with "m2" equal to "0" + And the conclusion of the committee should have a record with "m1" equal to "2.66667" + And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0" + + Scenario: Fuel use coefficients committee from cohort where all aircraft are missing fuel use equation + Given a flight emitter + And a characteristic "segments_per_trip" of "1" + And a characteristic "origin_airport.iata_code" of "AIA" + And a characteristic "airline.iata_code" of "EA" + When the "cohort" committee is calculated + And the "fuel_use_coefficients" committee is calculated + Then the committee should have used quorum "from cohort" + And the conclusion of the committee should have a record with "m3" equal to "0" + And the conclusion of the committee should have a record with "m2" equal to "0" + And the conclusion of the committee should have a record with "m1" equal to "4" + And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0" + Scenario: Fuel use coefficients committee from default Given a flight emitter When the "fuel_use_coefficients" committee is calculated Then the committee should have used quorum "default" And the conclusion of the committee should have a record with "m3" equal to "0" And the conclusion of the committee should have a record with "m2" equal to "0" - And the conclusion of the committee should have a record with "m1" equal to "1.66667" + And the conclusion of the committee should have a record with "m1" equal to "1.4" And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0" Scenario: Dogleg factor committee from segments per trip Given a flight emitter And a characteristic "segments_per_trip" of "2" @@ -360,50 +376,24 @@ And a characteristic "distance_class.name" of "petite" When the "distance" committee is calculated Then the committee should have used quorum "from distance class" And the conclusion of the committee should be "100.0" - Scenario Outline: Distance committee from cohort where all distances > 0 + Scenario: Distance committee from cohort Given a flight emitter And a characteristic "segments_per_trip" of "1" - And a characteristic "origin_airport.iata_code" of "<origin>" + And a characteristic "origin_airport.iata_code" of "ADA" 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 | distance | - | ADA | 100.0 | - | AIA | 1000.0 | + And the conclusion of the committee should be "100.0" - Scenario Outline: Distance committee from cohort where some distances > 0 - Given a flight emitter - And a characteristic "segments_per_trip" of "1" - And a characteristic "origin_airport.iata_code" of "<origin>" - 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 | distance | - | ADA | 100.0 | - | AIA | 1000.0 | - - Scenario: Distance committee from cohort where all distances = 0 - Given a flight emitter - And a characteristic "segments_per_trip" of "1" - And a characteristic "origin_airport.iata_code" of "WEA" - When the "cohort" committee is calculated - And the "distance" committee is calculated - Then the committee should have used quorum "default" - And the conclusion of the committee should be "366.66667" - 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 "366.66667" + And the conclusion of the committee should be "640.0" Scenario: Adjusted distance committee from distance, route inefficiency factor, and dogleg factor Given a flight emitter And a characteristic "distance" of "100" And a characteristic "route_inefficiency_factor" of "1.1" @@ -419,11 +409,11 @@ Then the conclusion of the committee should be "50" Scenario: Fuel per segment committee Given a flight emitter And a characteristic "adjusted_distance_per_segment" of "100" - And a characteristic "aircraft.icao_code" of "BA1" + And a characteristic "aircraft.bp_code" of "BP-BA1" When the "fuel_use_coefficients" committee is calculated And the "fuel_per_segment" committee is calculated Then the conclusion of the committee should be "200" Scenario: Fuel committee @@ -442,33 +432,5 @@ Scenario: Emission factor committee from default fuel type Given a flight emitter When the "fuel_type" committee is calculated And the "emission_factor" committee is calculated Then the conclusion of the committee should be "1.0" - - # Scenario: Emission committee from origin ADA - # Given a flight emitter - # And a characteristic "segments_per_trip" of "1" - # And a characteristic "aircraft.icao_code" of "FM1" - # And a characteristic "date" of "2010-01-01" - # And a characteristic "timeframe" of "2010-01-01/2010-12-31" - # When the "cohort" committee is calculated - # When the "country" committee is calculated - # And the "seat_class_multiplier" committee is calculated - # And the "trips" committee is calculated - # And the "freight_share" committee is calculated - # And the "load_factor" committee is calculated - # And the "seats" committee is calculated - # And the "passengers" committee is calculated - # And the "fuel_type" committee is calculated - # And the "fuel_use_coefficients" committee is calculated - # And the "dogleg_factor" committee is calculated - # And the "route_inefficiency_factor" committee is calculated - # And the "distance" committee is calculated - # And the "adjusted_distance" committee is calculated - # And the "adjusted_distance_per_segment" committee is calculated - # And the "fuel_per_segment" committee is calculated - # And the "fuel" committee is calculated - # And the "aviation_multiplier" committee is calculated - # And the "emission_factor" committee is calculated - # And the "emission" committee is calculated - # Then the conclusion of the committee should be "4.2"