automobile 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/automobile/carbon_model.rb +12 -4
- metadata +16 -28
@@ -190,7 +190,9 @@ module BrighterPlanet
|
|
190
190
|
fuel_efficiency_city = characteristics[:make_model_year_variant].fuel_efficiency_city
|
191
191
|
fuel_efficiency_highway = characteristics[:make_model_year_variant].fuel_efficiency_highway
|
192
192
|
urbanity = characteristics[:urbanity]
|
193
|
-
|
193
|
+
if fuel_efficiency_city.present? and fuel_efficiency_highway.present?
|
194
|
+
1.0 / ((urbanity / fuel_efficiency_city) + ((1.0 - urbanity) / fuel_efficiency_highway))
|
195
|
+
end
|
194
196
|
end
|
195
197
|
|
196
198
|
#### Fuel efficiency from make model year and urbanity
|
@@ -202,7 +204,9 @@ module BrighterPlanet
|
|
202
204
|
fuel_efficiency_city = characteristics[:make_model_year].fuel_efficiency_city
|
203
205
|
fuel_efficiency_highway = characteristics[:make_model_year].fuel_efficiency_highway
|
204
206
|
urbanity = characteristics[:urbanity]
|
205
|
-
|
207
|
+
if fuel_efficiency_city.present? and fuel_efficiency_highway.present?
|
208
|
+
1.0 / ((urbanity / fuel_efficiency_city) + ((1.0 - urbanity) / fuel_efficiency_highway))
|
209
|
+
end
|
206
210
|
end
|
207
211
|
|
208
212
|
#### Fuel efficiency from make model and urbanity
|
@@ -214,7 +218,9 @@ module BrighterPlanet
|
|
214
218
|
fuel_efficiency_city = characteristics[:make_model].fuel_efficiency_city
|
215
219
|
fuel_efficiency_highway = characteristics[:make_model].fuel_efficiency_highway
|
216
220
|
urbanity = characteristics[:urbanity]
|
217
|
-
|
221
|
+
if fuel_efficiency_city.present? and fuel_efficiency_highway.present?
|
222
|
+
1.0 / ((urbanity / fuel_efficiency_city) + ((1.0 - urbanity) / fuel_efficiency_highway))
|
223
|
+
end
|
218
224
|
end
|
219
225
|
|
220
226
|
#### Fuel efficiency from size class, hybridity multiplier, and urbanity
|
@@ -227,7 +233,9 @@ module BrighterPlanet
|
|
227
233
|
fuel_efficiency_city = characteristics[:size_class].fuel_efficiency_city
|
228
234
|
fuel_efficiency_highway = characteristics[:size_class].fuel_efficiency_highway
|
229
235
|
urbanity = characteristics[:urbanity]
|
230
|
-
|
236
|
+
if fuel_efficiency_city.present? and fuel_efficiency_highway.present?
|
237
|
+
(1.0 / ((urbanity / fuel_efficiency_city) + ((1.0 - urbanity) / fuel_efficiency_highway))) * characteristics[:hybridity_multiplier]
|
238
|
+
end
|
231
239
|
end
|
232
240
|
|
233
241
|
#### Fuel efficiency from make year and hybridity multiplier
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: automobile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 29
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
8
|
+
- 5
|
9
|
+
version: 0.1.5
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Andy Rossmeissl
|
@@ -19,108 +18,100 @@ autorequire:
|
|
19
18
|
bindir: bin
|
20
19
|
cert_chain: []
|
21
20
|
|
22
|
-
date: 2010-12-
|
21
|
+
date: 2010-12-16 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: 57
|
64
59
|
segments:
|
65
60
|
- 0
|
66
61
|
- 8
|
67
62
|
- 3
|
68
63
|
version: 0.8.3
|
69
64
|
type: :development
|
65
|
+
prerelease: false
|
70
66
|
version_requirements: *id003
|
71
67
|
- !ruby/object:Gem::Dependency
|
72
68
|
name: jeweler
|
73
|
-
prerelease: false
|
74
69
|
requirement: &id004 !ruby/object:Gem::Requirement
|
75
70
|
none: false
|
76
71
|
requirements:
|
77
72
|
- - ~>
|
78
73
|
- !ruby/object:Gem::Version
|
79
|
-
hash: 7
|
80
74
|
segments:
|
81
75
|
- 1
|
82
76
|
- 4
|
83
77
|
- 0
|
84
78
|
version: 1.4.0
|
85
79
|
type: :development
|
80
|
+
prerelease: false
|
86
81
|
version_requirements: *id004
|
87
82
|
- !ruby/object:Gem::Dependency
|
88
83
|
name: rake
|
89
|
-
prerelease: false
|
90
84
|
requirement: &id005 !ruby/object:Gem::Requirement
|
91
85
|
none: false
|
92
86
|
requirements:
|
93
87
|
- - ">="
|
94
88
|
- !ruby/object:Gem::Version
|
95
|
-
hash: 3
|
96
89
|
segments:
|
97
90
|
- 0
|
98
91
|
version: "0"
|
99
92
|
type: :development
|
93
|
+
prerelease: false
|
100
94
|
version_requirements: *id005
|
101
95
|
- !ruby/object:Gem::Dependency
|
102
96
|
name: rdoc
|
103
|
-
prerelease: false
|
104
97
|
requirement: &id006 !ruby/object:Gem::Requirement
|
105
98
|
none: false
|
106
99
|
requirements:
|
107
100
|
- - ">="
|
108
101
|
- !ruby/object:Gem::Version
|
109
|
-
hash: 3
|
110
102
|
segments:
|
111
103
|
- 0
|
112
104
|
version: "0"
|
113
105
|
type: :development
|
106
|
+
prerelease: false
|
114
107
|
version_requirements: *id006
|
115
108
|
- !ruby/object:Gem::Dependency
|
116
109
|
name: rspec
|
117
|
-
prerelease: false
|
118
110
|
requirement: &id007 !ruby/object:Gem::Requirement
|
119
111
|
none: false
|
120
112
|
requirements:
|
121
113
|
- - ~>
|
122
114
|
- !ruby/object:Gem::Version
|
123
|
-
hash: 62196417
|
124
115
|
segments:
|
125
116
|
- 2
|
126
117
|
- 0
|
@@ -129,50 +120,48 @@ dependencies:
|
|
129
120
|
- 17
|
130
121
|
version: 2.0.0.beta.17
|
131
122
|
type: :development
|
123
|
+
prerelease: false
|
132
124
|
version_requirements: *id007
|
133
125
|
- !ruby/object:Gem::Dependency
|
134
126
|
name: sniff
|
135
|
-
prerelease: false
|
136
127
|
requirement: &id008 !ruby/object:Gem::Requirement
|
137
128
|
none: false
|
138
129
|
requirements:
|
139
130
|
- - ">="
|
140
131
|
- !ruby/object:Gem::Version
|
141
|
-
hash: 3
|
142
132
|
segments:
|
143
133
|
- 0
|
144
134
|
version: "0"
|
145
135
|
type: :development
|
136
|
+
prerelease: false
|
146
137
|
version_requirements: *id008
|
147
138
|
- !ruby/object:Gem::Dependency
|
148
139
|
name: emitter
|
149
|
-
prerelease: false
|
150
140
|
requirement: &id009 !ruby/object:Gem::Requirement
|
151
141
|
none: false
|
152
142
|
requirements:
|
153
143
|
- - ~>
|
154
144
|
- !ruby/object:Gem::Version
|
155
|
-
hash: 13
|
156
145
|
segments:
|
157
146
|
- 0
|
158
147
|
- 3
|
159
148
|
version: "0.3"
|
160
149
|
type: :runtime
|
150
|
+
prerelease: false
|
161
151
|
version_requirements: *id009
|
162
152
|
- !ruby/object:Gem::Dependency
|
163
153
|
name: earth
|
164
|
-
prerelease: false
|
165
154
|
requirement: &id010 !ruby/object:Gem::Requirement
|
166
155
|
none: false
|
167
156
|
requirements:
|
168
157
|
- - ~>
|
169
158
|
- !ruby/object:Gem::Version
|
170
|
-
hash: 13
|
171
159
|
segments:
|
172
160
|
- 0
|
173
161
|
- 3
|
174
162
|
version: "0.3"
|
175
163
|
type: :runtime
|
164
|
+
prerelease: false
|
176
165
|
version_requirements: *id010
|
177
166
|
description: A software model in Ruby for the greenhouse gas emissions of an automobile
|
178
167
|
email: andy@rossmeissl.net
|
@@ -195,8 +184,8 @@ files:
|
|
195
184
|
- lib/automobile/summarization.rb
|
196
185
|
- lib/test_support/automobile_record.rb
|
197
186
|
- features/support/env.rb
|
198
|
-
- features/automobile_committees.feature
|
199
187
|
- features/automobile_emissions.feature
|
188
|
+
- features/automobile_committees.feature
|
200
189
|
has_rdoc: true
|
201
190
|
homepage: http://github.com/brighterplanet/automobile
|
202
191
|
licenses: []
|
@@ -211,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
211
200
|
requirements:
|
212
201
|
- - ">="
|
213
202
|
- !ruby/object:Gem::Version
|
214
|
-
hash:
|
203
|
+
hash: -843551345
|
215
204
|
segments:
|
216
205
|
- 0
|
217
206
|
version: "0"
|
@@ -220,7 +209,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
209
|
requirements:
|
221
210
|
- - ">="
|
222
211
|
- !ruby/object:Gem::Version
|
223
|
-
hash: 3
|
224
212
|
segments:
|
225
213
|
- 0
|
226
214
|
version: "0"
|
@@ -233,6 +221,6 @@ specification_version: 3
|
|
233
221
|
summary: A carbon model
|
234
222
|
test_files:
|
235
223
|
- features/support/env.rb
|
236
|
-
- features/automobile_committees.feature
|
237
224
|
- features/automobile_emissions.feature
|
225
|
+
- features/automobile_committees.feature
|
238
226
|
- lib/test_support/automobile_record.rb
|