automobile_trip 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/Gemfile +8 -0
  4. data/Gemfile.lock +200 -0
  5. data/LICENSE-PREAMBLE +52 -0
  6. data/Rakefile +71 -0
  7. data/VERSION +1 -0
  8. data/automobile_trip.gemspec +27 -0
  9. data/dot.rvmrc +9 -0
  10. data/features/automobile_trip_committees.feature +415 -16
  11. data/features/automobile_trip_emissions.feature +142 -12
  12. data/features/step_definitions/automobile_trip_steps.rb +15 -0
  13. data/features/step_definitions/mapquest_steps.rb +5 -0
  14. data/features/support/env.rb +7 -1
  15. data/lib/automobile_trip.rb +1 -0
  16. data/lib/automobile_trip/carbon_model.rb +570 -13
  17. data/lib/automobile_trip/characterization.rb +20 -1
  18. data/lib/automobile_trip/data.rb +21 -4
  19. data/lib/automobile_trip/fallback.rb +6 -2
  20. data/lib/automobile_trip/relationships.rb +7 -1
  21. data/lib/automobile_trip/version.rb +5 -0
  22. data/lib/test_support/db/fixtures/automobile_fuels.csv +4 -0
  23. data/lib/test_support/db/fixtures/automobile_make_model_year_variants.csv +2 -0
  24. data/lib/test_support/db/fixtures/automobile_make_model_years.csv +2 -0
  25. data/lib/test_support/db/fixtures/automobile_make_models.csv +2 -0
  26. data/lib/test_support/db/fixtures/automobile_make_years.csv +2 -0
  27. data/lib/test_support/db/fixtures/automobile_makes.csv +2 -0
  28. data/lib/test_support/db/fixtures/automobile_size_classes.csv +3 -0
  29. data/lib/test_support/db/fixtures/automobile_type_fuel_years.csv +5 -0
  30. data/lib/test_support/db/fixtures/automobile_type_years.csv +3 -0
  31. data/lib/test_support/db/fixtures/fuel_years.csv +2 -0
  32. data/lib/test_support/db/fixtures/fuels.csv +4 -0
  33. data/lib/test_support/db/fixtures/greenhouse_gases.csv +3 -0
  34. data/vendor/plugin/mapquest/README.textile +70 -0
  35. data/vendor/plugin/mapquest/Rakefile +15 -0
  36. data/vendor/plugin/mapquest/init.rb +1 -0
  37. data/vendor/plugin/mapquest/lib/mapquest_directions.rb +56 -0
  38. data/vendor/plugin/mapquest/spec/lib/mapquest_directions.xml +2 -0
  39. data/vendor/plugin/mapquest/spec/lib/mapquest_directions_fail.xml +2 -0
  40. data/vendor/plugin/mapquest/spec/lib/mapquest_directions_spec.rb +58 -0
  41. data/vendor/plugin/mapquest/spec/spec_helper.rb +13 -0
  42. metadata +55 -121
  43. data/lib/automobile_trip/committee_structure.rb +0 -65
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ gem 'emitter', :path => ENV['LOCAL_EMITTER'] if ENV['LOCAL_EMITTER']
2
+ gem 'sniff', :path => ENV['LOCAL_SNIFF'] if ENV['LOCAL_SNIFF']
3
+ gem 'earth', :path => ENV['LOCAL_EARTH'] if ENV['LOCAL_EARTH']
4
+ source :rubygems
5
+
6
+ gemspec :path => '.'
7
+
8
+ gem 'roo', '~> 1.9.3'
@@ -0,0 +1,200 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ automobile_trip (0.1.0)
5
+ emitter (~> 0.4.1)
6
+ geokit
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ aaronh-chronic (0.3.9)
12
+ activemodel (3.0.4)
13
+ activesupport (= 3.0.4)
14
+ builder (~> 2.1.2)
15
+ i18n (~> 0.4)
16
+ activerecord (3.0.4)
17
+ activemodel (= 3.0.4)
18
+ activesupport (= 3.0.4)
19
+ arel (~> 2.0.2)
20
+ tzinfo (~> 0.3.23)
21
+ activesupport (3.0.4)
22
+ amatch (0.2.5)
23
+ andand (1.3.1)
24
+ arel (2.0.8)
25
+ blockenspiel (0.4.1)
26
+ bueller (0.0.4)
27
+ bundler (~> 1.0.9)
28
+ git (>= 1.2.5)
29
+ rake
30
+ builder (2.1.2)
31
+ characterizable (0.1.2)
32
+ activesupport (>= 2.3.5)
33
+ blockenspiel (>= 0.3.2)
34
+ cohort_scope (0.1.4)
35
+ activerecord (>= 3.0.0.beta4)
36
+ activesupport (>= 3.0.0.beta4)
37
+ common_name (0.1.5)
38
+ activesupport (>= 2.3.4)
39
+ conversions (1.4.5)
40
+ activesupport (>= 2.3.4)
41
+ cucumber (0.10.0)
42
+ builder (>= 2.1.2)
43
+ diff-lcs (~> 1.1.2)
44
+ gherkin (~> 2.3.2)
45
+ json (~> 1.4.6)
46
+ term-ansicolor (~> 1.0.5)
47
+ data_miner (1.1.4)
48
+ activerecord (>= 2.3.4)
49
+ activesupport (>= 2.3.4)
50
+ blockenspiel (>= 0.3.2)
51
+ conversions (>= 1.4.4)
52
+ errata (>= 1.0.1)
53
+ escape (>= 0.0.4)
54
+ remote_table (>= 1.1.0)
55
+ taps (>= 0.3.11)
56
+ diff-lcs (1.1.2)
57
+ earth (0.4.0)
58
+ activerecord (~> 3)
59
+ cohort_scope (>= 0.0.7)
60
+ conversions (>= 1.4.5)
61
+ data_miner (~> 1.1.1)
62
+ errata
63
+ falls_back_on (>= 0.0.3)
64
+ geokit (>= 1.5.0)
65
+ geokit-rails
66
+ loose_tight_dictionary (>= 0.0.8)
67
+ weighted_average (>= 0.0.4)
68
+ emitter (0.4.1)
69
+ activesupport (>= 2.3.4)
70
+ characterizable
71
+ cohort_scope
72
+ data_miner (>= 1.1)
73
+ earth
74
+ falls_back_on
75
+ leap
76
+ summary_judgement
77
+ timeframe
78
+ weighted_average
79
+ errata (1.0.1)
80
+ activesupport (>= 2.3.4)
81
+ remote_table (~> 1)
82
+ escape (0.0.4)
83
+ falls_back_on (0.0.3)
84
+ activerecord
85
+ fast_timestamp (0.0.4)
86
+ fastercsv (1.5.4)
87
+ geokit (1.5.0)
88
+ geokit-rails (1.1.4)
89
+ geokit (>= 1.5.0)
90
+ gherkin (2.3.3)
91
+ json (~> 1.4.6)
92
+ git (1.2.5)
93
+ google-spreadsheet-ruby (0.1.2)
94
+ nokogiri (>= 1.4.3.1)
95
+ oauth (>= 0.3.6)
96
+ i18n (0.5.0)
97
+ json (1.4.6)
98
+ leap (0.4.6)
99
+ activesupport (>= 2.3.4)
100
+ blockenspiel (>= 0.3.2)
101
+ builder
102
+ i18n
103
+ loose_tight_dictionary (0.0.9)
104
+ activesupport (>= 2.3.4)
105
+ amatch (>= 0.2.5)
106
+ andand (>= 1.3.1)
107
+ mime-types (1.16)
108
+ mustache (0.12.0)
109
+ nokogiri (1.4.4)
110
+ oauth (0.4.4)
111
+ rack (1.2.1)
112
+ rake (0.8.7)
113
+ rcov (0.9.9)
114
+ rdiscount (1.6.8)
115
+ rdoc (3.5.3)
116
+ remote_table (1.1.0)
117
+ activesupport (>= 2.3.4)
118
+ builder
119
+ escape (>= 0.0.4)
120
+ fastercsv (>= 1.5.0)
121
+ google-spreadsheet-ruby
122
+ i18n
123
+ nokogiri (>= 1.4.1)
124
+ roo (~> 1.9)
125
+ slither (>= 0.99.4)
126
+ spreadsheet
127
+ zip
128
+ rest-client (1.6.1)
129
+ mime-types (>= 1.16)
130
+ rocco (0.5)
131
+ mustache
132
+ rdiscount
133
+ roo (1.9.3)
134
+ rspec (2.0.1)
135
+ rspec-core (~> 2.0.1)
136
+ rspec-expectations (~> 2.0.1)
137
+ rspec-mocks (~> 2.0.1)
138
+ rspec-core (2.0.1)
139
+ rspec-expectations (2.0.1)
140
+ diff-lcs (>= 1.1.2)
141
+ rspec-mocks (2.0.1)
142
+ rspec-core (~> 2.0.1)
143
+ rspec-expectations (~> 2.0.1)
144
+ ruby-ole (1.2.11.1)
145
+ sequel (3.17.0)
146
+ sinatra (1.0)
147
+ rack (>= 1.0)
148
+ slither (0.99.4)
149
+ sniff (0.6.1)
150
+ aaronh-chronic (~> 0.3.9)
151
+ activerecord (~> 3.0.0)
152
+ activesupport (~> 3.0.0)
153
+ bueller (~> 0.0.4)
154
+ common_name (~> 0.1.5)
155
+ cucumber (~> 0.10.0)
156
+ earth
157
+ fast_timestamp (~> 0.0.4)
158
+ rake
159
+ rcov
160
+ rdoc
161
+ rocco
162
+ rspec (~> 2.0.0)
163
+ sqlite3-ruby (~> 1.3.0)
164
+ timecop
165
+ timeframe (~> 0.0.8)
166
+ spreadsheet (0.6.5.2)
167
+ ruby-ole (>= 1.0)
168
+ sqlite3 (1.3.3)
169
+ sqlite3-ruby (1.3.3)
170
+ sqlite3 (>= 1.3.3)
171
+ summary_judgement (1.3.8)
172
+ activesupport (>= 2.3.4)
173
+ verbs (>= 2.0.6)
174
+ taps (0.3.15)
175
+ json (~> 1.4.6)
176
+ rack (>= 1.0.1)
177
+ rest-client (>= 1.4.0, < 1.7.0)
178
+ sequel (~> 3.17.0)
179
+ sinatra (~> 1.0.0)
180
+ sqlite3-ruby (~> 1.2)
181
+ term-ansicolor (1.0.5)
182
+ timecop (0.3.5)
183
+ timeframe (0.0.8)
184
+ activesupport (>= 2.3.5)
185
+ tzinfo (0.3.24)
186
+ verbs (2.0.9)
187
+ activesupport (>= 2.3.4)
188
+ andand (>= 1.3.1)
189
+ weighted_average (0.0.6)
190
+ activerecord (~> 3)
191
+ arel (~> 2)
192
+ zip (2.0.2)
193
+
194
+ PLATFORMS
195
+ ruby
196
+
197
+ DEPENDENCIES
198
+ automobile_trip!
199
+ roo (~> 1.9.3)
200
+ sniff (~> 0.6.0)
@@ -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
+ 'Automobile trip,' officially distributed from
12
+ http://github.com/brighterplanet/automobile_trip.
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.
@@ -0,0 +1,71 @@
1
+ require 'rubygems'
2
+
3
+ def require_or_fail(gems, message, failure_results_in_death = false)
4
+ gems = [gems] unless gems.is_a?(Array)
5
+
6
+ begin
7
+ gems.each { |gem| require gem }
8
+ yield
9
+ rescue LoadError
10
+ puts message
11
+ exit if failure_results_in_death
12
+ end
13
+ end
14
+
15
+ unless ENV['NOBUNDLE']
16
+ message = <<-MESSAGE
17
+ In order to run tests, you must:
18
+ * `gem install bundler`
19
+ * `bundle install`
20
+ MESSAGE
21
+ require_or_fail('bundler',message,true) do
22
+ Bundler.setup
23
+ end
24
+ end
25
+
26
+ require_or_fail('jeweler', 'Jeweler (or a dependency) not available. Install it with: gem install jeweler') do
27
+ Jeweler::Tasks.new do |gem|
28
+ gem.name = "automobile_trip"
29
+ gem.summary = %Q{A carbon model}
30
+ gem.description = %Q{A software model in Ruby for the greenhouse gas emissions of an automobile trip}
31
+ gem.email = "andy@rossmeissl.net"
32
+ gem.homepage = "http://github.com/brighterplanet/automobile_trip"
33
+ gem.authors = ["Andy Rossmeissl", "Seamus Abshere", "Ian Hough", "Matt Kling", 'Derek Kastner']
34
+ gem.files = ['LICENSE', 'README.rdoc'] +
35
+ Dir.glob(File.join('lib', '**','*.rb'))
36
+ gem.test_files = Dir.glob(File.join('features', '**', '*.rb')) +
37
+ Dir.glob(File.join('features', '**', '*.feature')) +
38
+ Dir.glob(File.join('lib', 'test_support', '**/*.rb')) +
39
+ Dir.glob(File.join('vendor', '**/*.rb'))
40
+ gem.add_development_dependency 'activerecord', '~>3'
41
+ gem.add_development_dependency 'bundler', '~>1.0.0'
42
+ gem.add_development_dependency 'rake'
43
+ gem.add_development_dependency 'cucumber'
44
+ gem.add_development_dependency 'jeweler', '~>1.4.0'
45
+ gem.add_development_dependency 'rdoc'
46
+ gem.add_development_dependency 'rspec', '~>2'
47
+ gem.add_development_dependency 'sniff', '~>0.6' unless ENV['LOCAL_SNIFF']
48
+ gem.add_development_dependency 'fastercsv'
49
+ gem.add_dependency 'emitter', '~>0.4.1' unless ENV['LOCAL_EMITTER']
50
+ gem.add_dependency 'earth' unless ENV['LOCAL_EARTH']
51
+ gem.add_dependency 'geokit'
52
+ end
53
+ Jeweler::GemcutterTasks.new
54
+ end
55
+
56
+ require_or_fail('sniff', 'Sniff gem not found, sniff tasks unavailable') do
57
+ require 'sniff/rake_tasks'
58
+ Sniff::RakeTasks.define_tasks do |t|
59
+ t.earth_domains = [:automobile, :fuel]
60
+ end
61
+ end
62
+
63
+ require 'rake/rdoctask'
64
+ Rake::RDocTask.new do |rdoc|
65
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
66
+
67
+ rdoc.rdoc_dir = 'rdoc'
68
+ rdoc.title = "lodging #{version}"
69
+ rdoc.rdoc_files.include('README*')
70
+ rdoc.rdoc_files.include('lib/**/*.rb')
71
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.9
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "automobile_trip/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = %q{automobile_trip}
7
+ s.version = BrighterPlanet::AutomobileTrip::VERSION
8
+
9
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
+ s.authors = ["Andy Rossmeissl", "Seamus Abshere", "Ian Hough", "Matt Kling", "Derek Kastner"]
11
+ s.date = %q{2011-02-14}
12
+ s.summary = %q{A carbon model}
13
+ s.description = %q{A software model in Ruby for the greenhouse gas emissions of an automobile trip}
14
+ s.email = %q{andy@rossmeissl.net}
15
+ s.homepage = %q{http://github.com/brighterplanet/automobile_trip}
16
+ s.rdoc_options = ["--charset=UTF-8"]
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.require_paths = ["lib"]
22
+
23
+ s.add_development_dependency 'sniff', "~> 0.6.0"
24
+ s.add_runtime_dependency 'emitter', "~> 0.4.1"
25
+ s.add_runtime_dependency 'geokit'
26
+ end
27
+
@@ -0,0 +1,9 @@
1
+ rvm 1.8.7
2
+ project=`basename \`pwd\``
3
+ if rvm gemset list | grep $project
4
+ then
5
+ rvm 1.8.7@$project
6
+ else
7
+ rvm gemset create $project
8
+ rvm gemset use $project
9
+ fi
@@ -1,29 +1,428 @@
1
1
  Feature: Automobile Trip Committee Calculations
2
2
  The automobile trip model should generate correct committee calculations
3
+
4
+ # FIXME TODO test for compliance
5
+
6
+ # FIXME TODO write a test for the mapquest api key committee
7
+ # Scenario: Mapquest API key committee from default
8
+ # Given an automobile_trip emitter
9
+ # When the "mapquest_api_key" committee is calculated
10
+ # Then the committee should have used quorum "default"
11
+ # And the conclusion of the committee should be "SECRET KEY"
3
12
 
4
- Scenario: Fuel Use committee from default
13
+ Scenario: Date committee from timeframe
5
14
  Given an automobile_trip emitter
6
- When the "fuel_use" committee is calculated
15
+ And a characteristic "timeframe" of "2009-06-06/2010-01-01"
16
+ When the "date" committee is calculated
17
+ Then the committee should have used quorum "from timeframe"
18
+ And the conclusion of the committee should be "2009-06-06"
19
+
20
+ Scenario: Urbanity committee from default
21
+ Given an automobile_trip emitter
22
+ When the "urbanity" committee is calculated
23
+ Then the committee should have used quorum "default"
24
+ And the conclusion of the committee should be "0.43"
25
+
26
+ Scenario Outline: Urbanity committee from valid urbanity estimate
27
+ Given an automobile_trip emitter
28
+ And a characteristic "urbanity_estimate" of "<estimate>"
29
+ When the "urbanity" committee is calculated
30
+ Then the committee should have used quorum "from urbanity estimate"
31
+ And the conclusion of the committee should be "<urbanity>"
32
+ Examples:
33
+ | estimate | urbanity |
34
+ | 0.0 | 0.0 |
35
+ | 0.3 | 0.3 |
36
+ | 1 | 1.0 |
37
+
38
+ Scenario Outline: Urbanity committee from invalid urbanity estimate
39
+ Given an automobile_trip emitter
40
+ And a characteristic "urbanity_estimate" of "<estimate>"
41
+ When the "urbanity" committee is calculated
42
+ Then the committee should have used quorum "default"
43
+ And the conclusion of the committee should be "0.43"
44
+ Examples:
45
+ | estimate |
46
+ | -0.1 |
47
+ | 1.1 |
48
+
49
+ Scenario: Hybridity multiplier committee from default
50
+ Given an automobile_trip emitter
51
+ When the "hybridity_multiplier" committee is calculated
52
+ Then the committee should have used quorum "default"
53
+ And the conclusion of the committee should be "1.0"
54
+
55
+ Scenario Outline: Hybridity multiplier committee from hybridity and urbanity
56
+ Given an automobile_trip emitter
57
+ And a characteristic "hybridity" of "<hybridity>"
58
+ When the "urbanity" committee is calculated
59
+ And the "hybridity_multiplier" committee is calculated
60
+ Then the committee should have used quorum "from hybridity and urbanity"
61
+ And the conclusion of the committee should be "<multiplier>"
62
+ Examples:
63
+ | hybridity | multiplier |
64
+ | true | 1.36919 |
65
+ | false | 0.99211 |
66
+
67
+ Scenario Outline: Hybridity multiplier committee from size class missing hybridity multipliers
68
+ Given an automobile_trip emitter
69
+ And a characteristic "hybridity" of "<hybridity>"
70
+ And a characteristic "size_class.name" of "<size_class>"
71
+ When the "urbanity" committee is calculated
72
+ And the "hybridity_multiplier" committee is calculated
73
+ Then the committee should have used quorum "from hybridity and urbanity"
74
+ And the conclusion of the committee should be "<multiplier>"
75
+ Examples:
76
+ | hybridity | size_class | multiplier |
77
+ | true | Midsize Wagon | 1.36919 |
78
+ | false | Midsize Wagon | 0.99211 |
79
+
80
+ Scenario Outline: Hybridity multiplier committee from size class with hybridity multipliers
81
+ Given an automobile_trip emitter
82
+ And a characteristic "hybridity" of "<hybridity>"
83
+ And a characteristic "size_class.name" of "<size_class>"
84
+ When the "urbanity" committee is calculated
85
+ And the "hybridity_multiplier" committee is calculated
86
+ Then the committee should have used quorum "from size class, hybridity, and urbanity"
87
+ And the conclusion of the committee should be "<multiplier>"
88
+ Examples:
89
+ | hybridity | size_class | multiplier |
90
+ | true | Midsize Car | 1.68067 |
91
+ | false | Midsize Car | 0.87464 |
92
+
93
+ Scenario Outline: Fuel efficiency committee from hybridity multiplier
94
+ Given an automobile_trip emitter
95
+ And a characteristic "hybridity_multiplier" of "<multiplier>"
96
+ When the "fuel_efficiency" committee is calculated
97
+ Then the committee should have used quorum "from hybridity multiplier"
98
+ And the conclusion of the committee should be "<fe>"
99
+ Examples:
100
+ | multiplier | fe |
101
+ | 1.0 | 8.58025 |
102
+ | 10 | 85.80250 |
103
+
104
+ Scenario: Fuel efficiency committee from make and hybridity multiplier
105
+ Given an automobile_trip emitter
106
+ And a characteristic "make.name" of "Toyota"
107
+ And a characteristic "hybridity_multiplier" of "2.0"
108
+ When the "fuel_efficiency" committee is calculated
109
+ Then the committee should have used quorum "from make and hybridity multiplier"
110
+ And the conclusion of the committee should be "20.0"
111
+
112
+ Scenario: Fuel efficiency committee from make year and hybridity multiplier
113
+ Given an automobile_trip emitter
114
+ And a characteristic "make_year.name" of "Toyota 2003"
115
+ And a characteristic "hybridity_multiplier" of "2.0"
116
+ When the "fuel_efficiency" committee is calculated
117
+ Then the committee should have used quorum "from make year and hybridity multiplier"
118
+ And the conclusion of the committee should be "30.0"
119
+
120
+ Scenario: Fuel efficiency committee from size class, hybridity multiplier, and urbanity
121
+ Given an automobile_trip emitter
122
+ And a characteristic "size_class.name" of "Midsize Car"
123
+ And a characteristic "hybridity_multiplier" of "2.0"
124
+ And a characteristic "urbanity" of "0.5"
125
+ When the "fuel_efficiency" committee is calculated
126
+ Then the committee should have used quorum "from size class, hybridity multiplier, and urbanity"
127
+ And the conclusion of the committee should be "26.66667"
128
+
129
+ Scenario: Fuel efficiency committee from make model and urbanity
130
+ Given an automobile_trip emitter
131
+ And a characteristic "make_model.name" of "Toyota Prius"
132
+ And a characteristic "urbanity" of "0.5"
133
+ When the "fuel_efficiency" committee is calculated
134
+ Then the committee should have used quorum "from make model and urbanity"
135
+ And the conclusion of the committee should be "24.0"
136
+
137
+ Scenario: Fuel efficiency committee from make model year and urbanity
138
+ Given an automobile_trip emitter
139
+ And a characteristic "make_model_year.name" of "Toyota Prius 2003"
140
+ And a characteristic "urbanity" of "0.5"
141
+ When the "fuel_efficiency" committee is calculated
142
+ Then the committee should have used quorum "from make model year and urbanity"
143
+ And the conclusion of the committee should be "34.28571"
144
+
145
+ Scenario: Fuel efficiency committee from make model year variant and urbanity
146
+ Given an automobile_trip emitter
147
+ And a characteristic "make_model_year_variant.row_hash" of "xxx1"
148
+ And a characteristic "urbanity" of "0.5"
149
+ When the "fuel_efficiency" committee is calculated
150
+ Then the committee should have used quorum "from make model year variant and urbanity"
151
+ And the conclusion of the committee should be "44.44444"
152
+
153
+ Scenario: Speed committee from urbanity
154
+ Given an automobile_trip emitter
155
+ When the "urbanity" committee is calculated
156
+ And the "speed" committee is calculated
157
+ Then the committee should have used quorum "from urbanity"
158
+ And the conclusion of the committee should be "50.94388"
159
+
160
+ Scenario Outline: Origin location from geocodeable origin
161
+ Given a automobile_trip emitter
162
+ And a characteristic "origin" of address value "<origin>"
163
+ And the geocoder will encode the origin as "<geocode>"
164
+ When the "origin_location" committee is calculated
165
+ Then the committee should have used quorum "from origin"
166
+ And the conclusion of the committee should be "<location>"
167
+ Examples:
168
+ | origin | geocode | location |
169
+ | 05753 | 43.9968185,-73.1491165 | 43.9968185,-73.1491165 |
170
+ | San Francisco, CA | 37.7749295,-122.4194155 | 37.7749295,-122.4194155 |
171
+ | 488 Haight Street, San Francisco, CA | 37.7722302,-122.4303328 | 37.7722302,-122.4303328 |
172
+ | Canterbury, Kent, UK | 51.2772689,1.0805173 | 51.2772689,1.0805173 |
173
+
174
+ Scenario: Origin location from non-geocodeable origin
175
+ Given a automobile_trip emitter
176
+ And a characteristic "origin" of "Bag End, Hobbiton, Westfarthing, The Shire, Eriador, Middle Earth"
177
+ And the geocoder will encode the origin as ","
178
+ When the "origin_location" committee is calculated
179
+ Then the conclusion of the committee should be nil
180
+
181
+ Scenario Outline: Destination location from geocodeable destination
182
+ Given a automobile_trip emitter
183
+ And a characteristic "destination" of address value "<destination>"
184
+ And the geocoder will encode the destination as "<geocode>"
185
+ When the "destination_location" committee is calculated
186
+ Then the committee should have used quorum "from destination"
187
+ And the conclusion of the committee should be "<location>"
188
+ Examples:
189
+ | destination | geocode | location |
190
+ | 05753 | 43.9968185,-73.1491165 | 43.9968185,-73.1491165 |
191
+ | San Francisco, CA | 37.7749295,-122.4194155 | 37.7749295,-122.4194155 |
192
+ | 488 Haight Street, San Francisco, CA | 37.7722302,-122.4303328 | 37.7722302,-122.4303328 |
193
+ | Canterbury, Kent, UK | 51.2772689,1.0805173 | 51.2772689,1.0805173 |
194
+
195
+ Scenario: Destination location from non-geocodeable destination
196
+ Given a automobile_trip emitter
197
+ And a characteristic "destination" of "Bag End, Hobbiton, Westfarthing, The Shire, Eriador, Middle Earth"
198
+ And the geocoder will encode the destination as ","
199
+ When the "destination_location" committee is calculated
200
+ Then the conclusion of the committee should be nil
201
+
202
+ Scenario: Distance committee from default
203
+ Given an automobile_trip emitter
204
+ When the "distance" committee is calculated
7
205
  Then the committee should have used quorum "default"
8
- And the conclusion of the committee should be "57.0"
206
+ And the conclusion of the committee should be "16.33484"
9
207
 
10
- Scenario: Emission factor committee from fuel type
208
+ Scenario: Distance committee from duration and speed
11
209
  Given an automobile_trip emitter
12
- And a characteristic "fuel_type.name" of "Gasoline"
13
- And the "emission_factor" committee is calculated
14
- Then the committee should have used quorum "from fuel type"
210
+ And a characteristic "duration" of "120.0"
211
+ And a characteristic "speed" of "5.0"
212
+ When the "distance" committee is calculated
213
+ Then the committee should have used quorum "from duration and speed"
15
214
  And the conclusion of the committee should be "10.0"
16
215
 
17
- Scenario: Emission factor committee from default
216
+ Scenario Outline: Distance committee from origin and destination locations
18
217
  Given an automobile_trip emitter
19
- When the "emission_factor" committee is calculated
218
+ And a characteristic "origin_location" of "<origin>"
219
+ And a characteristic "destination_location" of "<destination>"
220
+ And a characteristic "mapquest_api_key" of "ABC123"
221
+ And mapquest determines the distance to be "<mapquest_distance>"
222
+ When the "distance" committee is calculated
223
+ Then the committee should have used quorum "from origin and destination locations"
224
+ And the conclusion of the committee should be "<distance>"
225
+ Examples:
226
+ | origin | destination | mapquest_distance | distance |
227
+ | 43,-73 | 43,-73 | 0.0 | 0.0 |
228
+ | 43,-73 | 43.1,-73 | 57.93638 | 57.93638 |
229
+
230
+ Scenario: Distance commitee from undriveable origin and destination locations
231
+ Given an automobile_trip emitter
232
+ And a characteristic "origin" of "Lansing, MI"
233
+ And a characteristic "destination" of "Canterbury, Kent, UK"
234
+ And a characteristic "mapquest_api_key" of "ABC123"
235
+ When the "origin_location" committee is calculated
236
+ And the "destination_location" committee is calculated
237
+ And the "distance" committee is calculated
238
+ Then the committee should have used quorum "default"
239
+ And the conclusion of the committee should be "16.33484"
240
+
241
+ Scenario: Fuel use committee from fuel efficiency and distance
242
+ Given an automobile_trip emitter
243
+ And a characteristic "fuel_efficiency" of "10.0"
244
+ And a characteristic "distance" of "100.0"
245
+ When the "fuel_use" committee is calculated
246
+ Then the committee should have used quorum "from fuel efficiency and distance"
247
+ And the conclusion of the committee should be "10.0"
248
+
249
+ Scenario: Fuel committee from default
250
+ Given an automobile_trip emitter
251
+ When the "automobile_fuel" committee is calculated
20
252
  Then the committee should have used quorum "default"
21
- And the conclusion of the committee should be "2.46315"
253
+ And the conclusion of the committee should have "base_fuel_name" of "Motor Gasoline"
254
+ And the conclusion of the committee should have "blend_fuel_name" of "Distillate Fuel Oil No. 2"
255
+ And the conclusion of the committee should have "distance_key" of "fallback"
256
+ And the conclusion of the committee should have "ef_key" of "fallback"
257
+
258
+ Scenario: Fuel committee from make model year variant
259
+ Given an automobile_trip emitter
260
+ And a characteristic "make_model_year_variant.row_hash" of "xxx1"
261
+ When the "automobile_fuel" committee is calculated
262
+ Then the committee should have used quorum "from make model year variant"
263
+ And the conclusion of the committee should have "name" of "regular gasoline"
264
+
265
+ Scenario: HFC emission factor committee from default automobile fuel
266
+ Given an automobile_trip emitter
267
+ When the "automobile_fuel" committee is calculated
268
+ And the "hfc_emission_factor" committee is calculated
269
+ Then the committee should have used quorum "from automobile fuel"
270
+ And the conclusion of the committee should be "0.10627"
271
+
272
+ Scenario Outline: HFC emission factor committee from automobile fuel
273
+ Given an automobile_trip emitter
274
+ And a characteristic "automobile_fuel.name" of "<fuel>"
275
+ When the "hfc_emission_factor" committee is calculated
276
+ Then the committee should have used quorum "from automobile fuel"
277
+ And the conclusion of the committee should be "<ef>"
278
+ Examples:
279
+ | fuel | ef |
280
+ | regular gasoline | 0.10592 |
281
+ | diesel | 0.12401 |
282
+ | B20 | 0.12401 |
283
+
284
+ Scenario: N2O emission factor committee from default automobile fuel
285
+ Given an automobile_trip emitter
286
+ When the "automobile_fuel" committee is calculated
287
+ And the "n2o_emission_factor" committee is calculated
288
+ Then the committee should have used quorum "from automobile fuel"
289
+ And the conclusion of the committee should be "0.00705"
290
+
291
+ Scenario Outline: N2O emission factor committee from automobile fuel
292
+ Given an automobile_trip emitter
293
+ And a characteristic "automobile_fuel.name" of "<fuel>"
294
+ When the "n2o_emission_factor" committee is calculated
295
+ Then the committee should have used quorum "from automobile fuel"
296
+ And the conclusion of the committee should be "<ef>"
297
+ Examples:
298
+ | fuel | ef |
299
+ | regular gasoline | 0.00715 |
300
+ | diesel | 0.00200 |
301
+ | B20 | 0.00200 |
302
+
303
+ Scenario: CH4 emission factor committee from default automobile fuel
304
+ Given an automobile_trip emitter
305
+ When the "automobile_fuel" committee is calculated
306
+ And the "ch4_emission_factor" committee is calculated
307
+ Then the committee should have used quorum "from automobile fuel"
308
+ And the conclusion of the committee should be "0.00226"
309
+
310
+ Scenario Outline: CH4 emission factor committee from automobile fuel
311
+ Given an automobile_trip emitter
312
+ And a characteristic "automobile_fuel.name" of "<fuel>"
313
+ When the "ch4_emission_factor" committee is calculated
314
+ Then the committee should have used quorum "from automobile fuel"
315
+ And the conclusion of the committee should be "<ef>"
316
+ Examples:
317
+ | fuel | ef |
318
+ | regular gasoline | 0.00230 |
319
+ | diesel | 0.00010 |
320
+ | B20 | 0.00010 |
321
+
322
+ Scenario: CO2 biogenic emission factor committee from default automobile fuel
323
+ Given an automobile_trip emitter
324
+ When the "automobile_fuel" committee is calculated
325
+ And the "co2_biogenic_emission_factor" committee is calculated
326
+ Then the committee should have used quorum "from automobile fuel"
327
+ And the conclusion of the committee should be "0.0"
328
+
329
+ Scenario Outline: CO2 biogenic emission factor committee from automobile fuel
330
+ Given an automobile_trip emitter
331
+ And a characteristic "automobile_fuel.name" of "<fuel>"
332
+ When the "co2_biogenic_emission_factor" committee is calculated
333
+ Then the committee should have used quorum "from automobile fuel"
334
+ And the conclusion of the committee should be "<ef>"
335
+ Examples:
336
+ | fuel | ef |
337
+ | regular gasoline | 0.0 |
338
+ | diesel | 0.0 |
339
+ | B20 | 0.5 |
340
+
341
+ Scenario: CO2 emission factor committee from default automobile fuel
342
+ Given an automobile_trip emitter
343
+ When the "automobile_fuel" committee is calculated
344
+ And the "co2_emission_factor" committee is calculated
345
+ Then the committee should have used quorum "from automobile fuel"
346
+ And the conclusion of the committee should be "2.30958"
347
+
348
+ Scenario Outline: CO2 emission factor committee from automobile fuel
349
+ Given an automobile_trip emitter
350
+ And a characteristic "automobile_fuel.name" of "<fuel>"
351
+ When the "co2_emission_factor" committee is calculated
352
+ Then the committee should have used quorum "from automobile fuel"
353
+ And the conclusion of the committee should be "<ef>"
354
+ Examples:
355
+ | fuel | ef |
356
+ | regular gasoline | 2.3 |
357
+ | diesel | 2.7 |
358
+ | B20 | 2.16 |
359
+
360
+ Scenario Outline: HFC emission from fuel use, hfc emission factor, date, and timeframe
361
+ Given an automobile_trip emitter
362
+ And a characteristic "fuel_use" of "<fuel_use>"
363
+ And a characteristic "hfc_emission_factor" of "<ef>"
364
+ And a characteristic "date" of "<date>"
365
+ And a characteristic "timeframe" of "<timeframe>"
366
+ When the "hfc_emission" committee is calculated
367
+ Then the committee should have used quorum "from fuel use, hfc emission factor, date, and timeframe"
368
+ And the conclusion of the committee should be "<emission>"
369
+ Examples:
370
+ | fuel_use | ef | date | timeframe | emission |
371
+ | 10.0 | 2.0 | 2010-06-01 | 2010-01-01/2011-01-01 | 20.0 |
372
+ | 10.0 | 2.0 | 2009-06-01 | 2010-01-01/2011-01-01 | 0.0 |
373
+
374
+ Scenario Outline: N2O emission from fuel use, n2o emission factor, date, and timeframe
375
+ Given an automobile_trip emitter
376
+ And a characteristic "fuel_use" of "<fuel_use>"
377
+ And a characteristic "n2o_emission_factor" of "<ef>"
378
+ And a characteristic "date" of "<date>"
379
+ And a characteristic "timeframe" of "<timeframe>"
380
+ When the "n2o_emission" committee is calculated
381
+ Then the committee should have used quorum "from fuel use, n2o emission factor, date, and timeframe"
382
+ And the conclusion of the committee should be "<emission>"
383
+ Examples:
384
+ | fuel_use | ef | date | timeframe | emission |
385
+ | 10.0 | 2.0 | 2010-06-01 | 2010-01-01/2011-01-01 | 20.0 |
386
+ | 10.0 | 2.0 | 2009-06-01 | 2010-01-01/2011-01-01 | 0.0 |
387
+
388
+ Scenario Outline: CH4 emission from fuel use, ch4 emission factor, date, and timeframe
389
+ Given an automobile_trip emitter
390
+ And a characteristic "fuel_use" of "<fuel_use>"
391
+ And a characteristic "ch4_emission_factor" of "<ef>"
392
+ And a characteristic "date" of "<date>"
393
+ And a characteristic "timeframe" of "<timeframe>"
394
+ When the "ch4_emission" committee is calculated
395
+ Then the committee should have used quorum "from fuel use, ch4 emission factor, date, and timeframe"
396
+ And the conclusion of the committee should be "<emission>"
397
+ Examples:
398
+ | fuel_use | ef | date | timeframe | emission |
399
+ | 10.0 | 2.0 | 2010-06-01 | 2010-01-01/2011-01-01 | 20.0 |
400
+ | 10.0 | 2.0 | 2009-06-01 | 2010-01-01/2011-01-01 | 0.0 |
401
+
402
+ Scenario Outline: CO2 biogenic emission from fuel use, co2 biogenic emission factor, date, and timeframe
403
+ Given an automobile_trip emitter
404
+ And a characteristic "fuel_use" of "<fuel_use>"
405
+ And a characteristic "co2_biogenic_emission_factor" of "<ef>"
406
+ And a characteristic "date" of "<date>"
407
+ And a characteristic "timeframe" of "<timeframe>"
408
+ When the "co2_biogenic_emission" committee is calculated
409
+ Then the committee should have used quorum "from fuel use, co2 biogenic emission factor, date, and timeframe"
410
+ And the conclusion of the committee should be "<emission>"
411
+ Examples:
412
+ | fuel_use | ef | date | timeframe | emission |
413
+ | 10.0 | 2.0 | 2010-06-01 | 2010-01-01/2011-01-01 | 20.0 |
414
+ | 10.0 | 2.0 | 2009-06-01 | 2010-01-01/2011-01-01 | 0.0 |
22
415
 
23
- Scenario: Emission committee from fuel use and emission factor
416
+ Scenario Outline: CO2 emission from fuel use, co2 emission factor, date, and timeframe
24
417
  Given an automobile_trip emitter
25
- And a characteristic "fuel_use" of "100"
26
- And a characteristic "emission_factor" of "1.5"
27
- When the "emission" committee is calculated
28
- Then the committee should have used quorum "from fuel use and emission factor"
29
- And the conclusion of the committee should be "150"
418
+ And a characteristic "fuel_use" of "<fuel_use>"
419
+ And a characteristic "co2_emission_factor" of "<ef>"
420
+ And a characteristic "date" of "<date>"
421
+ And a characteristic "timeframe" of "<timeframe>"
422
+ When the "co2_emission" committee is calculated
423
+ Then the committee should have used quorum "from fuel use, co2 emission factor, date, and timeframe"
424
+ And the conclusion of the committee should be "<emission>"
425
+ Examples:
426
+ | fuel_use | ef | date | timeframe | emission |
427
+ | 10.0 | 2.0 | 2010-06-01 | 2010-01-01/2011-01-01 | 20.0 |
428
+ | 10.0 | 2.0 | 2009-06-01 | 2010-01-01/2011-01-01 | 0.0 |