flight 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,52 @@
1
+ BRIGHTER PLANET ADDITIONAL PREAMBLE TO THE GNU AFFERO GENERAL PUBLIC LICENSE
2
+ January 7, 2011
3
+
4
+ This preamble is meant to help the licensee understand exactly what
5
+ software is being received under the license and set expectations as to
6
+ what is not covered.
7
+
8
+ IDENTITY OF THE SOFTWARE MODULE COVERED BY LICENSE:
9
+
10
+ This license covers the Brighter Planet carbon model referred to as
11
+ 'Flight,' officially distributed from
12
+ http://github.com/brighterplanet/flight.
13
+
14
+ SCOPE OF THE SOFTWARE MODULE COVERED BY LICENSE:
15
+
16
+ The scope of the license includes only those files included in the
17
+ official Brighter Planet distribution package for the particular carbon
18
+ model identified above, including only the carbon model execution files,
19
+ reference data classes, input characterization, fallbacks, summarization
20
+ helpers, tests, and test fixtures.
21
+
22
+ WHAT IS NOT COVERED BY LICENSE:
23
+
24
+ This license does not extend to the following:
25
+
26
+ * Any element of any Brighter Planet website, including but not
27
+ limited the copyrights, trademarks, graphic design, text,
28
+ documentation, method of interaction with clients, runtime
29
+ environment, technical infrastructure, and software code associated
30
+ therewith;
31
+
32
+ * Any element of any Brighter Planet website user interface, including
33
+ but not limited to the copyrights, trademarks, graphic design, text,
34
+ documentation, method of interaction with clients, runtime
35
+ environment, technical infrastructure, and software code associated
36
+ therewith;
37
+
38
+ * Any element of other software modules licensed under any form of
39
+ license including but not limited to other forms of open source
40
+ license, commercial license, and the like;
41
+
42
+ * Any element of any Brighter Planet Carbon Middleware web service,
43
+ including but not limited to the copyrights, trademarks, graphic
44
+ design, text, documentation, method of interaction with clients,
45
+ runtime environment, technical infrastructure, and software code, is
46
+ not covered by the license; and
47
+
48
+ * Any aspect or use of http://carbon.brighterplanet.com.
49
+
50
+ If you have any questions, please contact licensing@brighterplanet.com
51
+
52
+ Copyright 2010, 2011 Brighter Planet, Inc.
@@ -12,93 +12,55 @@ Feature: Flight Committee Calculations
12
12
  When the "segments_per_trip" committee is calculated
13
13
  Then the conclusion of the committee should be "1.67"
14
14
 
15
- Scenario: Cohort committee for a direct flight from origin
15
+ Scenario Outline: Cohort committee from various characteristics
16
16
  Given a flight emitter
17
17
  And a characteristic "segments_per_trip" of "1"
18
- And a characteristic "origin_airport.iata_code" of "AIA"
19
- When the "cohort" committee is calculated
20
- Then the conclusion of the committee should have a record with "count" equal to "3"
21
-
22
- Scenario: Cohort committee for a direct flight from destination
23
- Given a flight emitter
24
- And a characteristic "segments_per_trip" of "1"
25
- And a characteristic "destination_airport.iata_code" of "WEA"
26
- When the "cohort" committee is calculated
27
- Then the conclusion of the committee should have a record with "count" equal to "3"
28
-
29
- Scenario: Cohort committee for a direct flight from aircraft
30
- Given a flight emitter
31
- And a characteristic "segments_per_trip" of "1"
32
- And a characteristic "aircraft.bp_code" of "BP-FM1"
33
- When the "cohort" committee is calculated
34
- Then the conclusion of the committee should have a record with "count" equal to "1"
35
-
36
- Scenario: Cohort committee for a direct flight from airline
37
- Given a flight emitter
38
- And a characteristic "segments_per_trip" of "1"
39
- And a characteristic "airline.iata_code" of "DA"
40
- When the "cohort" committee is calculated
41
- Then the conclusion of the committee should have a record with "count" equal to "2"
42
-
43
- Scenario: Cohort committee for an indirect flight with usable characteristics
44
- Given a flight emitter
45
- And a characteristic "segments_per_trip" of "2"
46
- And a characteristic "origin_airport.iata_code" of "AIA"
47
- When the "cohort" committee is calculated
48
- Then the conclusion of the committee should be nil
49
-
50
- Scenario: Cohort committee for a direct flight with origin that exists but is not in t100
51
- Given a flight emitter
52
- And a characteristic "segments_per_trip" of "1"
53
- And a characteristic "origin_airport.iata_code" of "XXX"
54
- When the "cohort" committee is calculated
55
- Then the conclusion of the committee should be nil
56
-
57
- Scenario: Cohort committee for a direct flight with destination that exists but is not in t100
58
- Given a flight emitter
59
- And a characteristic "segments_per_trip" of "1"
60
- And a characteristic "destination_airport.iata_code" of "ADA"
18
+ And a characteristic "origin_airport.iata_code" of "<origin_iata>"
19
+ And a characteristic "destination_airport.iata_code" of "<destination_iata>"
20
+ And a characteristic "aircraft.bp_code" of "<aircraft_code>"
21
+ And a characteristic "airline.iata_code" of "<airline_iata>"
61
22
  When the "cohort" committee is calculated
62
- Then the conclusion of the committee should be nil
63
-
64
- Scenario: Cohort committee for a direct flight with aircraft that exists but is not in t100
65
- Given a flight emitter
66
- And a characteristic "segments_per_trip" of "1"
67
- And a characteristic "aircraft.bp_code" of "BP-XX2"
68
- When the "cohort" committee is calculated
69
- Then the conclusion of the committee should be nil
70
-
71
- Scenario: Cohort committee for a direct flight with airline that exists but is not in t100
72
- Given a flight emitter
73
- And a characteristic "segments_per_trip" of "1"
74
- And a characteristic "airline.iata_code" of "XX"
75
- When the "cohort" committee is calculated
76
- Then the conclusion of the committee should be nil
77
-
78
- Scenario: Cohort committee for a direct flight with origin and destination that do not match
79
- Given a flight emitter
80
- And a characteristic "segments_per_trip" of "1"
81
- And a characteristic "origin_airport.iata_code" of "ADA"
82
- And a characteristic "destination_airport.iata_code" of "WEA"
83
- When the "cohort" committee is calculated
84
- Then the conclusion of the committee should have a record with "count" equal to "2"
85
-
86
- Scenario: Cohort committee for a direct flight with origin that exists but is not in t100 and destination in t100
87
- Given a flight emitter
88
- And a characteristic "segments_per_trip" of "1"
89
- And a characteristic "origin_airport.iata_code" of "XXX"
90
- And a characteristic "destination_airport.iata_code" of "AIA"
23
+ Then the conclusion of the committee should have a record with "count" equal to "<records>"
24
+ Examples:
25
+ | origin_iata | destination_iata | aircraft_code | airline_iata | records |
26
+ | AIA | | | | 3 |
27
+ | | WEA | | | 3 |
28
+ | | | BP-FM1 | | 1 |
29
+ | | | | DA | 2 |
30
+ | | WEA | BP-BA1 | | 2 |
31
+ | AIA | XXX | | IA | 3 |
32
+ | ADA | WEA | | | 2 |
33
+ # origin ok
34
+ # dest ok
35
+ # aircraft ok
36
+ # airline ok
37
+ # two characteristics
38
+ # origin + airline ok but dest not in t100
39
+ # origin + dest don't match
40
+
41
+ Scenario Outline: Cohort committe from various unusable characteristics
42
+ Given a flight emitter
43
+ And a characteristic "segments_per_trip" of "<segments>"
44
+ And a characteristic "origin_airport.iata_code" of "<origin_iata>"
45
+ And a characteristic "destination_airport.iata_code" of "<destination_iata>"
46
+ And a characteristic "aircraft.bp_code" of "<aircraft_code>"
47
+ And a characteristic "airline.iata_code" of "<airline_iata>"
91
48
  When the "cohort" committee is calculated
92
49
  Then the conclusion of the committee should be nil
93
-
94
- Scenario: Cohort committee for a direct flight with origin in t100, destination that exists but is not in t100, and airline that matches origin
95
- Given a flight emitter
96
- And a characteristic "segments_per_trip" of "1"
97
- And a characteristic "origin_airport.iata_code" of "AIA"
98
- And a characteristic "destination_airport.iata_code" of "XXX"
99
- And a characteristic "airline.iata_code" of "IA"
100
- When the "cohort" committee is calculated
101
- Then the conclusion of the committee should have a record with "count" equal to "3"
50
+ Examples:
51
+ | segments | origin_iata | destination_iata | aircraft_code | airline_iata |
52
+ | 2 | AIA | | | |
53
+ | 1 | XXX | | | |
54
+ | 1 | | ADA | | |
55
+ | 1 | | | BP-XX2 | |
56
+ | 1 | | | | XX |
57
+ | 1 | XXX | AIA | | XX |
58
+ # indirect flight
59
+ # origin exists but not in t100
60
+ # dest exists but not in t100
61
+ # aircraft exists but not in t100
62
+ # airline exists but not in t100
63
+ # origin not in t100, dest in t100
102
64
 
103
65
  Scenario: Aircraft class committee from aircraft
104
66
  Given a flight emitter
@@ -144,14 +106,23 @@ Feature: Flight Committee Calculations
144
106
  When the "trips" committee is calculated
145
107
  Then the conclusion of the committee should be "1.941"
146
108
 
147
- Scenario: Freight share committee from cohort
109
+ Scenario Outline: Freight share committee from cohort
148
110
  Given a flight emitter
149
111
  And a characteristic "segments_per_trip" of "1"
150
- And a characteristic "origin_airport.iata_code" of "AIA"
112
+ And a characteristic "origin_airport.iata_code" of "<origin_iata>"
113
+ And a characteristic "destination_airport.iata_code" of "<destination_iata>"
114
+ And a characteristic "aircraft.bp_code" of "<aircraft_code>"
115
+ And a characteristic "airline.iata_code" of "<airline_iata>"
151
116
  When the "cohort" committee is calculated
152
117
  And the "freight_share" committee is calculated
153
118
  Then the committee should have used quorum "from cohort"
154
- And the conclusion of the committee should be "0.06205"
119
+ And the conclusion of the committee should be "<freight_share>"
120
+ Examples:
121
+ | origin_iata | destination_iata | aircraft_code | airline_iata | freight_share |
122
+ | AIA | | | | 0.06205 |
123
+ | | WEA | | | 0.06205 |
124
+ | | | BP-FM1 | | 0.00990 |
125
+ | | | | DA | 0.01475 |
155
126
 
156
127
  Scenario: Freight share committee from default
157
128
  Given a flight emitter
@@ -159,14 +130,23 @@ Feature: Flight Committee Calculations
159
130
  Then the committee should have used quorum "default"
160
131
  And the conclusion of the committee should be "0.04313"
161
132
 
162
- Scenario: Load factor committee from cohort
133
+ Scenario Outline: Load factor committee from cohort
163
134
  Given a flight emitter
164
135
  And a characteristic "segments_per_trip" of "1"
165
- And a characteristic "origin_airport.iata_code" of "AIA"
136
+ And a characteristic "origin_airport.iata_code" of "<origin_iata>"
137
+ And a characteristic "destination_airport.iata_code" of "<destination_iata>"
138
+ And a characteristic "aircraft.bp_code" of "<aircraft_code>"
139
+ And a characteristic "airline.iata_code" of "<airline_iata>"
166
140
  When the "cohort" committee is calculated
167
141
  And the "load_factor" committee is calculated
168
142
  Then the committee should have used quorum "from cohort"
169
- And the conclusion of the committee should be "0.81197"
143
+ And the conclusion of the committee should be "<load_factor>"
144
+ Examples:
145
+ | origin_iata | destination_iata | aircraft_code | airline_iata | load_factor |
146
+ | AIA | | | | 0.81197 |
147
+ | | WEA | | | 0.81197 |
148
+ | | | BP-FM1 | | 0.8 |
149
+ | | | | DA | 0.81667 |
170
150
 
171
151
  Scenario: Load factor committee from default
172
152
  Given a flight emitter
@@ -205,14 +185,21 @@ Feature: Flight Committee Calculations
205
185
  Then the committee should have used quorum "from seats estimate"
206
186
  And the conclusion of the committee should be "100"
207
187
 
208
- Scenario: Seats committee from cohort
188
+ Scenario Outline: Seats committee from cohort
209
189
  Given a flight emitter
210
190
  And a characteristic "segments_per_trip" of "1"
211
- And a characteristic "origin_airport.iata_code" of "ADA"
191
+ And a characteristic "origin_airport.iata_code" of "<origin_iata>"
192
+ And a characteristic "destination_airport.iata_code" of "<destination_iata>"
193
+ And a characteristic "airline.iata_code" of "<airline_iata>"
212
194
  When the "cohort" committee is calculated
213
195
  And the "seats" committee is calculated
214
196
  Then the committee should have used quorum "from cohort"
215
- And the conclusion of the committee should be "122.5"
197
+ And the conclusion of the committee should be "<seats>"
198
+ Examples:
199
+ | origin_iata | destination_iata | airline_iata | seats |
200
+ | AIA | | | 123.33333 |
201
+ | | WEA | | 123.33333 |
202
+ | | | DA | 122.5 |
216
203
 
217
204
  Scenario: Seats committee from aircraft class
218
205
  Given a flight emitter
@@ -227,12 +214,16 @@ Feature: Flight Committee Calculations
227
214
  Then the committee should have used quorum "default"
228
215
  And the conclusion of the committee should be "123.0"
229
216
 
230
- Scenario: Passengers committee from seats and load factor
217
+ Scenario Outline: Passengers committee from seats and load factor
231
218
  Given a flight emitter
232
- And a characteristic "seats" of "105"
233
- And a characteristic "load_factor" of "0.9"
219
+ And a characteristic "seats" of "<seats>"
220
+ And a characteristic "load_factor" of "<load_factor>"
234
221
  When the "passengers" committee is calculated
235
- Then the conclusion of the committee should be "95"
222
+ Then the conclusion of the committee should be "<passengers>"
223
+ Examples:
224
+ | seats | load_factor | passengers |
225
+ | 105 | 0.9 | 95.0 |
226
+ | 123 | 0.81385 | 100.0 |
236
227
 
237
228
  Scenario: Fuel type committee from default
238
229
  Given a flight emitter
@@ -249,10 +240,10 @@ Feature: Flight Committee Calculations
249
240
  And the conclusion of the committee should have a record with "m1" equal to "<m1>"
250
241
  And the conclusion of the committee should have a record with "endpoint_fuel" equal to "<b>"
251
242
  Examples:
252
- | code | m3 | m2 | m1 | b |
253
- | BP-FM1 | 0 | 0 | 1 | 0 |
254
- | BP-BA1 | 0 | 0 | 2 | 0 |
255
- | BP-XX2 | 0 | 0 | 4 | 0 |
243
+ | code | m3 | m2 | m1 | b |
244
+ | BP-FM1 | 0.0 | 0.0 | 1.0 | 0.0 |
245
+ | BP-BA1 | 0.0 | 0.0 | 2.0 | 0.0 |
246
+ | BP-XX2 | 0.0 | 0.0 | 4.0 | 0.0 |
256
247
 
257
248
  Scenario Outline: Fuel use coefficients committee from aircraft missing fuel use coefficients
258
249
  Given a flight emitter
@@ -260,10 +251,10 @@ Feature: Flight Committee Calculations
260
251
  When the "aircraft_class" committee is calculated
261
252
  And the "fuel_use_coefficients" committee is calculated
262
253
  Then the committee should have used quorum "from aircraft class"
263
- And the conclusion of the committee should have a record with "m3" equal to "0"
264
- And the conclusion of the committee should have a record with "m2" equal to "0"
254
+ And the conclusion of the committee should have a record with "m3" equal to "0.0"
255
+ And the conclusion of the committee should have a record with "m2" equal to "0.0"
265
256
  And the conclusion of the committee should have a record with "m1" equal to "4"
266
- And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0"
257
+ And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0.0"
267
258
  Examples:
268
259
  | code |
269
260
  | BP-XX1f |
@@ -275,62 +266,57 @@ Feature: Flight Committee Calculations
275
266
  And a characteristic "aircraft_class.code" of "EX"
276
267
  When the "fuel_use_coefficients" committee is calculated
277
268
  Then the committee should have used quorum "from aircraft class"
278
- And the conclusion of the committee should have a record with "m3" equal to "0"
279
- And the conclusion of the committee should have a record with "m2" equal to "0"
269
+ And the conclusion of the committee should have a record with "m3" equal to "0.0"
270
+ And the conclusion of the committee should have a record with "m2" equal to "0.0"
280
271
  And the conclusion of the committee should have a record with "m1" equal to "1.75"
281
- And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0"
282
-
283
- Scenario: Fuel use coefficients committee from cohort where all aircraft have fuel use equation
284
- Given a flight emitter
285
- And a characteristic "segments_per_trip" of "1"
286
- And a characteristic "origin_airport.iata_code" of "ADA"
287
- When the "cohort" committee is calculated
288
- And the "fuel_use_coefficients" committee is calculated
289
- Then the committee should have used quorum "from cohort"
290
- And the conclusion of the committee should have a record with "m3" equal to "0"
291
- And the conclusion of the committee should have a record with "m2" equal to "0"
292
- And the conclusion of the committee should have a record with "m1" equal to "1.5"
293
- And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0"
294
-
295
- Scenario: Fuel use coefficients committee from cohort where some aircraft are missing fuel use equation
296
- Given a flight emitter
297
- And a characteristic "segments_per_trip" of "1"
298
- And a characteristic "origin_airport.iata_code" of "AIA"
299
- When the "cohort" committee is calculated
300
- And the "fuel_use_coefficients" committee is calculated
301
- Then the committee should have used quorum "from cohort"
302
- And the conclusion of the committee should have a record with "m3" equal to "0"
303
- And the conclusion of the committee should have a record with "m2" equal to "0"
304
- And the conclusion of the committee should have a record with "m1" equal to "2.66667"
305
- And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0"
272
+ And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0.0"
306
273
 
307
- Scenario: Fuel use coefficients committee from cohort where all aircraft are missing fuel use equation
274
+ Scenario Outline: Fuel use coefficients from various cohorts
308
275
  Given a flight emitter
309
276
  And a characteristic "segments_per_trip" of "1"
310
- And a characteristic "origin_airport.iata_code" of "AIA"
311
- And a characteristic "airline.iata_code" of "EA"
277
+ And a characteristic "origin_airport.iata_code" of "<origin_iata>"
278
+ And a characteristic "destination_airport.iata_code" of "<destination_iata>"
279
+ And a characteristic "airline.iata_code" of "<airline_iata>"
312
280
  When the "cohort" committee is calculated
313
281
  And the "fuel_use_coefficients" committee is calculated
314
282
  Then the committee should have used quorum "from cohort"
315
- And the conclusion of the committee should have a record with "m3" equal to "0"
316
- And the conclusion of the committee should have a record with "m2" equal to "0"
317
- And the conclusion of the committee should have a record with "m1" equal to "4"
318
- And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0"
283
+ And the conclusion of the committee should have a record with "m3" equal to "<m3>"
284
+ And the conclusion of the committee should have a record with "m2" equal to "<m2>"
285
+ And the conclusion of the committee should have a record with "m1" equal to "<m1>"
286
+ And the conclusion of the committee should have a record with "endpoint_fuel" equal to "<b>"
287
+ Examples:
288
+ | origin_iata | destination_iata | airline_iata | m3 | m2 | m1 | b |
289
+ | AIA | | | 0.0 | 0.0 | 2.66667 | 0.0 |
290
+ | | WEA | | 0.0 | 0.0 | 2.66667 | 0.0 |
291
+ | | | DA | 0.0 | 0.0 | 1.5 | 0.0 |
292
+ | AIA | | EA | 0.0 | 0.0 | 4.0 | 0.0 |
293
+ # some aircraft missing fuel use equation
294
+ # some aircraft missing fuel use equation
295
+ # all aircraft have fuel use equation
296
+ # all aircraft missing fuel use equation
319
297
 
320
298
  Scenario: Fuel use coefficients committee from default
321
299
  Given a flight emitter
322
300
  When the "fuel_use_coefficients" committee is calculated
323
301
  Then the committee should have used quorum "default"
324
- And the conclusion of the committee should have a record with "m3" equal to "0"
325
- And the conclusion of the committee should have a record with "m2" equal to "0"
302
+ And the conclusion of the committee should have a record with "m3" equal to "0.0"
303
+ And the conclusion of the committee should have a record with "m2" equal to "0.0"
326
304
  And the conclusion of the committee should have a record with "m1" equal to "1.4"
327
- And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0"
305
+ And the conclusion of the committee should have a record with "endpoint_fuel" equal to "0.0"
328
306
 
329
307
  Scenario: Dogleg factor committee from segments per trip
330
308
  Given a flight emitter
331
309
  And a characteristic "segments_per_trip" of "2"
332
310
  When the "dogleg_factor" committee is calculated
333
- Then the conclusion of the committee should be "1.25"
311
+ Then the committee should have used quorum "from segments per trip"
312
+ And the conclusion of the committee should be "1.25"
313
+
314
+ Scenario: Dogleg factor committee from default segments per trip
315
+ Given a flight emitter
316
+ When the "segments_per_trip" committee is calculated
317
+ And the "dogleg_factor" committee is calculated
318
+ Then the committee should have used quorum "from segments per trip"
319
+ And the conclusion of the committee should be "1.16126"
334
320
 
335
321
  Scenario: Route inefficiency factor committee from country
336
322
  Given a flight emitter
@@ -378,14 +364,37 @@ Feature: Flight Committee Calculations
378
364
  Then the committee should have used quorum "from distance class"
379
365
  And the conclusion of the committee should be "100.0"
380
366
 
381
- Scenario: Distance committee from cohort
367
+ Scenario: Distance committee from cohort based on origin
382
368
  Given a flight emitter
383
369
  And a characteristic "segments_per_trip" of "1"
384
- And a characteristic "origin_airport.iata_code" of "ADA"
370
+ And a characteristic "origin_airport.iata_code" of "AIA"
385
371
  When the "cohort" committee is calculated
386
372
  And the "distance" committee is calculated
387
373
  Then the committee should have used quorum "from cohort"
388
- And the conclusion of the committee should be "100.0"
374
+ And the conclusion of the committee should be "1000.0"
375
+
376
+ Scenario: Distance committee from cohort based on destination
377
+ Given a flight emitter
378
+ And a characteristic "segments_per_trip" of "1"
379
+ And a characteristic "destination_airport.iata_code" of "WEA"
380
+ When the "cohort" committee is calculated
381
+ And the "distance" committee is calculated
382
+ Then the committee should have used quorum "from cohort"
383
+ And the conclusion of the committee should be "1000.0"
384
+
385
+ Scenario Outline: Distance committee from cohort based on aircraft/airline
386
+ Given a flight emitter
387
+ And a characteristic "segments_per_trip" of "1"
388
+ And a characteristic "aircraft.bp_code" of "<aircraft_code>"
389
+ And a characteristic "airline.iata_code" of "<airline_iata>"
390
+ When the "cohort" committee is calculated
391
+ And the "distance" committee is calculated
392
+ Then the committee should have used quorum "from cohort"
393
+ And the conclusion of the committee should be "<distance>"
394
+ Examples:
395
+ | aircraft_code | airline_iata | distance |
396
+ | BP-FM1 | | 100.0 |
397
+ | | DA | 100.0 |
389
398
 
390
399
  Scenario: Distance committee from default
391
400
  Given a flight emitter
@@ -393,20 +402,28 @@ Feature: Flight Committee Calculations
393
402
  Then the committee should have used quorum "default"
394
403
  And the conclusion of the committee should be "640.0"
395
404
 
396
- Scenario: Adjusted distance committee from distance, route inefficiency factor, and dogleg factor
405
+ Scenario Outline: Adjusted distance committee from distance, route inefficiency factor, and dogleg factor
397
406
  Given a flight emitter
398
- And a characteristic "distance" of "100"
399
- And a characteristic "route_inefficiency_factor" of "1.1"
400
- And a characteristic "dogleg_factor" of "1.25"
407
+ And a characteristic "distance" of "<distance>"
408
+ And a characteristic "route_inefficiency_factor" of "<route_factor>"
409
+ And a characteristic "dogleg_factor" of "<dogleg>"
401
410
  When the "adjusted_distance" committee is calculated
402
- Then the conclusion of the committee should be "137.5"
411
+ Then the conclusion of the committee should be "<adj_dist>"
412
+ Examples:
413
+ | distance | route_factor | dogleg | adj_dist |
414
+ | 100 | 1.1 | 1.25 | 137.5 |
415
+ | 640 | 1.1 | 1.16126 | 817.52704 |
403
416
 
404
- Scenario: Adjusted distance per segment committee
417
+ Scenario Outline: Adjusted distance per segment committee
405
418
  Given a flight emitter
406
- And a characteristic "adjusted_distance" of "100"
407
- And a characteristic "segments_per_trip" of "2"
419
+ And a characteristic "adjusted_distance" of "<adj_dist>"
420
+ And a characteristic "segments_per_trip" of "<segments>"
408
421
  When the "adjusted_distance_per_segment" committee is calculated
409
- Then the conclusion of the committee should be "50"
422
+ Then the conclusion of the committee should be "<adj_d_per_s>"
423
+ Examples:
424
+ | adj_dist | segments | adj_d_per_s |
425
+ | 100 | 2 | 50 |
426
+ | 817.52749 | 1.67 | 489.53742 |
410
427
 
411
428
  Scenario: Fuel per segment committee
412
429
  Given a flight emitter
@@ -416,13 +433,24 @@ Feature: Flight Committee Calculations
416
433
  And the "fuel_per_segment" committee is calculated
417
434
  Then the conclusion of the committee should be "200"
418
435
 
419
- Scenario: Fuel committee
436
+ Scenario: Fuel per segment committee
420
437
  Given a flight emitter
421
- And a characteristic "fuel_per_segment" of "100"
422
- And a characteristic "segments_per_trip" of "2"
423
- And a characteristic "trips" of "2"
438
+ And a characteristic "adjusted_distance_per_segment" of "489.53742"
439
+ When the "fuel_use_coefficients" committee is calculated
440
+ And the "fuel_per_segment" committee is calculated
441
+ Then the conclusion of the committee should be "685.35239"
442
+
443
+ Scenario Outline: Fuel committee
444
+ Given a flight emitter
445
+ And a characteristic "fuel_per_segment" of "<fuel_per_s>"
446
+ And a characteristic "segments_per_trip" of "<segments>"
447
+ And a characteristic "trips" of "<trips>"
424
448
  When the "fuel" committee is calculated
425
- Then the conclusion of the committee should be "400"
449
+ Then the conclusion of the committee should be "<fuel>"
450
+ Examples:
451
+ | fuel_per_s | segments | trips | fuel |
452
+ | 100 | 2 | 2 | 400 |
453
+ | 685.35239 | 1.67 | 1.94100 | 2221.54921 |
426
454
 
427
455
  Scenario: Aviation multiplier committee from default
428
456
  Given a flight emitter
@@ -8,6 +8,7 @@ Feature: Flight Emissions Calculations
8
8
 
9
9
  Scenario Outline: Calculations from date
10
10
  Given a flight has "date" of "<date>"
11
+ And it is the year "2010"
11
12
  When emissions are calculated
12
13
  Then the emission value should be within "0.1" kgs of "<emission>"
13
14
  Examples:
@@ -29,15 +30,15 @@ Feature: Flight Emissions Calculations
29
30
 
30
31
  Scenario: Calculations from cohort based on origin
31
32
  Given a flight has "segments_per_trip" of "1"
32
- And it has "origin_airport.iata_code" of "ADA"
33
+ And it has "origin_airport.iata_code" of "AIA"
33
34
  When emissions are calculated
34
- Then the emission value should be within "0.1" kgs of "6.3"
35
+ Then the emission value should be within "0.1" kgs of "106.8"
35
36
 
36
37
  Scenario: Calculations from cohort based on destination
37
38
  Given a flight has "segments_per_trip" of "1"
38
- And it has "destination_airport.iata_code" of "AIA"
39
+ And it has "destination_airport.iata_code" of "WEA"
39
40
  When emissions are calculated
40
- Then the emission value should be within "0.1" kgs of "36.6"
41
+ Then the emission value should be within "0.1" kgs of "106.8"
41
42
 
42
43
  Scenario: Calculations from cohort based on aircraft
43
44
  Given a flight has "segments_per_trip" of "1"
@@ -59,7 +60,7 @@ Feature: Flight Emissions Calculations
59
60
  Scenario: Calculations from seat class
60
61
  Given a flight has "seat_class.name" of "economy"
61
62
  When emissions are calculated
62
- Then the emission value should be within "0.1" kgs of "38.2"
63
+ Then the emission value should be within "0.1" kgs of "38.3"
63
64
 
64
65
  Scenario: Calculations from trips
65
66
  Given a flight has "trips" of "2"
@@ -69,22 +70,22 @@ Feature: Flight Emissions Calculations
69
70
  Scenario: Calculations from load factor
70
71
  Given a flight has "load_factor" of "1"
71
72
  When emissions are calculated
72
- Then the emission value should be within "0.1" kgs of "34.5"
73
+ Then the emission value should be within "0.1" kgs of "34.6"
73
74
 
74
75
  Scenario: Calculations from seats estimate
75
76
  Given a flight has "seats_estimate" of "100"
76
77
  When emissions are calculated
77
- Then the emission value should be within "0.1" kgs of "52.4"
78
+ Then the emission value should be within "0.1" kgs of "52.5"
78
79
 
79
80
  Scenario: Calculations from aircraft class
80
81
  Given a flight has "aircraft_class.code" of "BX"
81
82
  When emissions are calculated
82
- Then the emission value should be within "0.1" kgs of "114.5"
83
+ Then the emission value should be within "0.1" kgs of "114.6"
83
84
 
84
85
  Scenario: Calculations from country
85
86
  Given a flight has "country.iso_3166_code" of "UK"
86
87
  When emissions are calculated
87
- Then the emission value should be within "0.1" kgs of "46.3"
88
+ Then the emission value should be within "0.1" kgs of "46.4"
88
89
 
89
90
  Scenario: Calculations from distance estimate
90
91
  Given a flight has "distance_estimate" of "185.2"
@@ -99,7 +100,7 @@ Feature: Flight Emissions Calculations
99
100
  Scenario: Calculations from aviation multiplier
100
101
  Given a flight has "aviation_multiplier" of "1"
101
102
  When emissions are calculated
102
- Then the emission value should be within "0.1" kgs of "21.2"
103
+ Then the emission value should be within "0.1" kgs of "21.3"
103
104
 
104
105
  Scenario: Calculations from fuel type
105
106
  Given a flight has "fuel_type.name" of "Aviation Gasoline"
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flight
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 1
9
- - 9
10
- version: 0.1.9
8
+ - 10
9
+ version: 0.1.10
11
10
  platform: ruby
12
11
  authors:
13
12
  - Andy Rossmeissl
@@ -19,171 +18,161 @@ autorequire:
19
18
  bindir: bin
20
19
  cert_chain: []
21
20
 
22
- date: 2010-12-14 00:00:00 -06:00
21
+ date: 2011-01-07 00:00:00 -05:00
23
22
  default_executable:
24
23
  dependencies:
25
24
  - !ruby/object:Gem::Dependency
26
25
  name: activerecord
27
- prerelease: false
28
26
  requirement: &id001 !ruby/object:Gem::Requirement
29
27
  none: false
30
28
  requirements:
31
29
  - - ~>
32
30
  - !ruby/object:Gem::Version
33
- hash: 5
34
31
  segments:
35
32
  - 3
36
33
  version: "3"
37
34
  type: :development
35
+ prerelease: false
38
36
  version_requirements: *id001
39
37
  - !ruby/object:Gem::Dependency
40
38
  name: bundler
41
- prerelease: false
42
39
  requirement: &id002 !ruby/object:Gem::Requirement
43
40
  none: false
44
41
  requirements:
45
42
  - - ~>
46
43
  - !ruby/object:Gem::Version
47
- hash: 23
48
44
  segments:
49
45
  - 1
50
46
  - 0
51
47
  - 0
52
48
  version: 1.0.0
53
49
  type: :development
50
+ prerelease: false
54
51
  version_requirements: *id002
55
52
  - !ruby/object:Gem::Dependency
56
53
  name: cucumber
57
- prerelease: false
58
54
  requirement: &id003 !ruby/object:Gem::Requirement
59
55
  none: false
60
56
  requirements:
61
57
  - - ">="
62
58
  - !ruby/object:Gem::Version
63
- hash: 3
64
59
  segments:
65
60
  - 0
66
61
  version: "0"
67
62
  type: :development
63
+ prerelease: false
68
64
  version_requirements: *id003
69
65
  - !ruby/object:Gem::Dependency
70
66
  name: jeweler
71
- prerelease: false
72
67
  requirement: &id004 !ruby/object:Gem::Requirement
73
68
  none: false
74
69
  requirements:
75
70
  - - ~>
76
71
  - !ruby/object:Gem::Version
77
- hash: 7
78
72
  segments:
79
73
  - 1
80
74
  - 4
81
75
  - 0
82
76
  version: 1.4.0
83
77
  type: :development
78
+ prerelease: false
84
79
  version_requirements: *id004
85
80
  - !ruby/object:Gem::Dependency
86
81
  name: rake
87
- prerelease: false
88
82
  requirement: &id005 !ruby/object:Gem::Requirement
89
83
  none: false
90
84
  requirements:
91
85
  - - ">="
92
86
  - !ruby/object:Gem::Version
93
- hash: 3
94
87
  segments:
95
88
  - 0
96
89
  version: "0"
97
90
  type: :development
91
+ prerelease: false
98
92
  version_requirements: *id005
99
93
  - !ruby/object:Gem::Dependency
100
94
  name: rdoc
101
- prerelease: false
102
95
  requirement: &id006 !ruby/object:Gem::Requirement
103
96
  none: false
104
97
  requirements:
105
98
  - - ">="
106
99
  - !ruby/object:Gem::Version
107
- hash: 3
108
100
  segments:
109
101
  - 0
110
102
  version: "0"
111
103
  type: :development
104
+ prerelease: false
112
105
  version_requirements: *id006
113
106
  - !ruby/object:Gem::Dependency
114
107
  name: rspec
115
- prerelease: false
116
108
  requirement: &id007 !ruby/object:Gem::Requirement
117
109
  none: false
118
110
  requirements:
119
111
  - - "="
120
112
  - !ruby/object:Gem::Version
121
- hash: 13
122
113
  segments:
123
114
  - 2
124
115
  - 0
125
116
  - 1
126
117
  version: 2.0.1
127
118
  type: :development
119
+ prerelease: false
128
120
  version_requirements: *id007
129
121
  - !ruby/object:Gem::Dependency
130
122
  name: sniff
131
- prerelease: false
132
123
  requirement: &id008 !ruby/object:Gem::Requirement
133
124
  none: false
134
125
  requirements:
135
126
  - - ~>
136
127
  - !ruby/object:Gem::Version
137
- hash: 13
138
128
  segments:
139
129
  - 0
140
- - 3
141
- version: "0.3"
130
+ - 4
131
+ - 12
132
+ version: 0.4.12
142
133
  type: :development
134
+ prerelease: false
143
135
  version_requirements: *id008
144
136
  - !ruby/object:Gem::Dependency
145
137
  name: emitter
146
- prerelease: false
147
138
  requirement: &id009 !ruby/object:Gem::Requirement
148
139
  none: false
149
140
  requirements:
150
141
  - - ~>
151
142
  - !ruby/object:Gem::Version
152
- hash: 13
153
143
  segments:
154
144
  - 0
155
145
  - 3
156
146
  version: "0.3"
157
147
  type: :runtime
148
+ prerelease: false
158
149
  version_requirements: *id009
159
150
  - !ruby/object:Gem::Dependency
160
151
  name: earth
161
- prerelease: false
162
152
  requirement: &id010 !ruby/object:Gem::Requirement
163
153
  none: false
164
154
  requirements:
165
155
  - - ~>
166
156
  - !ruby/object:Gem::Version
167
- hash: 13
168
157
  segments:
169
158
  - 0
170
159
  - 3
171
160
  version: "0.3"
172
161
  type: :runtime
162
+ prerelease: false
173
163
  version_requirements: *id010
174
164
  - !ruby/object:Gem::Dependency
175
165
  name: builder
176
- prerelease: false
177
166
  requirement: &id011 !ruby/object:Gem::Requirement
178
167
  none: false
179
168
  requirements:
180
169
  - - ">="
181
170
  - !ruby/object:Gem::Version
182
- hash: 3
183
171
  segments:
184
172
  - 0
185
173
  version: "0"
186
174
  type: :runtime
175
+ prerelease: false
187
176
  version_requirements: *id011
188
177
  description: A software model in Ruby for the greenhouse gas emissions of a flight
189
178
  email: andy@rossmeissl.net
@@ -193,6 +182,7 @@ extensions: []
193
182
 
194
183
  extra_rdoc_files:
195
184
  - LICENSE
185
+ - LICENSE-PREAMBLE
196
186
  - README.markdown
197
187
  - README.rdoc
198
188
  files:
@@ -207,10 +197,11 @@ files:
207
197
  - lib/flight/relationships.rb
208
198
  - lib/flight/summarization.rb
209
199
  - lib/test_support/flight_record.rb
200
+ - LICENSE-PREAMBLE
210
201
  - README.markdown
211
202
  - features/support/env.rb
212
- - features/flight_committees.feature
213
203
  - features/flight_emissions.feature
204
+ - features/flight_committees.feature
214
205
  has_rdoc: true
215
206
  homepage: http://github.com/brighterplanet/flight
216
207
  licenses: []
@@ -225,7 +216,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
225
216
  requirements:
226
217
  - - ">="
227
218
  - !ruby/object:Gem::Version
228
- hash: 3
219
+ hash: 805356979
229
220
  segments:
230
221
  - 0
231
222
  version: "0"
@@ -234,7 +225,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
225
  requirements:
235
226
  - - ">="
236
227
  - !ruby/object:Gem::Version
237
- hash: 3
238
228
  segments:
239
229
  - 0
240
230
  version: "0"
@@ -247,6 +237,6 @@ specification_version: 3
247
237
  summary: A carbon model
248
238
  test_files:
249
239
  - features/support/env.rb
250
- - features/flight_committees.feature
251
240
  - features/flight_emissions.feature
241
+ - features/flight_committees.feature
252
242
  - lib/test_support/flight_record.rb