/************************************************************************************ * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University * All rights reserved. * Refer to LICENSE for terms and conditions of use. ***********************************************************************************/ package vnsim.vehicular.emissions; public class EmissionsResults{ public double fc, co, co2, hc, nox; public EmissionsResults() { this.fc = 0; this.co = 0; this.co2 = 0; this.hc = 0; this.nox = 0; } public EmissionsResults(double fc, double co, double co2, double hc, double nox) { this.fc = fc; this.co = co; this.co2 = co2; this.hc = hc; this.nox = nox; } public void addEmissionsResults(EmissionsResults em, int coef) { fc+=em.fc / coef; co+=em.co / coef; co2+=em.co2 / coef; hc+=em.hc / coef; nox+=em.nox / coef; } @Override public String toString() { return "Fuel: " + fc + "\nCO2: " + co2 + "\nCO: " + co + "\nHC: " + hc + "\nNOx: " + nox; } }