Line | |
---|
1 | /************************************************************************************ |
---|
2 | * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University |
---|
3 | * All rights reserved. |
---|
4 | * Refer to LICENSE for terms and conditions of use. |
---|
5 | ***********************************************************************************/ |
---|
6 | package vnsim.vehicular.emissions; |
---|
7 | |
---|
8 | public class EmissionsResults{ |
---|
9 | public double fc, co, co2, hc, nox; |
---|
10 | |
---|
11 | public EmissionsResults() { |
---|
12 | this.fc = 0; |
---|
13 | this.co = 0; |
---|
14 | this.co2 = 0; |
---|
15 | this.hc = 0; |
---|
16 | this.nox = 0; |
---|
17 | } |
---|
18 | |
---|
19 | public EmissionsResults(double fc, double co, double co2, double hc, double nox) { |
---|
20 | this.fc = fc; |
---|
21 | this.co = co; |
---|
22 | this.co2 = co2; |
---|
23 | this.hc = hc; |
---|
24 | this.nox = nox; |
---|
25 | } |
---|
26 | |
---|
27 | public void addEmissionsResults(EmissionsResults em, int coef) { |
---|
28 | fc+=em.fc / coef; |
---|
29 | co+=em.co / coef; |
---|
30 | co2+=em.co2 / coef; |
---|
31 | hc+=em.hc / coef; |
---|
32 | nox+=em.nox / coef; |
---|
33 | } |
---|
34 | |
---|
35 | @Override |
---|
36 | public String toString() { |
---|
37 | return "Fuel: " + fc + |
---|
38 | "\nCO2: " + co2 + |
---|
39 | "\nCO: " + co + |
---|
40 | "\nHC: " + hc + |
---|
41 | "\nNOx: " + nox; |
---|
42 | } |
---|
43 | |
---|
44 | |
---|
45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.