Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2016-2024 German Aerospace Center (DLR) and others.
4 : // PHEMlight module
5 : // Copyright (C) 2016-2023 Technische Universitaet Graz, https://www.tugraz.at/
6 : // This program and the accompanying materials are made available under the
7 : // terms of the Eclipse Public License 2.0 which is available at
8 : // https://www.eclipse.org/legal/epl-2.0/
9 : // This Source Code may also be made available under the following Secondary
10 : // Licenses when the conditions for such availability set forth in the Eclipse
11 : // Public License 2.0 are satisfied: GNU General Public License, version 2
12 : // or later which is available at
13 : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14 : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15 : /****************************************************************************/
16 : /// @file CEPHandler.cpp
17 : /// @author Martin Dippold
18 : /// @author Michael Behrisch
19 : /// @date July 2016
20 : ///
21 : //
22 : /****************************************************************************/
23 : #include <config.h>
24 :
25 : #include <fstream>
26 : #include <sstream>
27 : #define JSON_USE_IMPLICIT_CONVERSIONS 0
28 : #include <foreign/nlohmann/json.hpp>
29 : #include <utils/common/StringUtils.h>
30 : #include "CEPHandler.h"
31 : #include "CEP.h"
32 : #include "Correction.h"
33 : #include "Helpers.h"
34 :
35 :
36 : namespace PHEMlightdllV5 {
37 :
38 45787 : CEPHandler::CEPHandler() {
39 45787 : }
40 :
41 114 : const std::map<std::string, CEP*>& CEPHandler::getCEPS() const {
42 114 : return _ceps;
43 : }
44 :
45 38 : bool CEPHandler::GetCEP(std::vector<std::string>& DataPath, Helpers* Helper, Correction* DataCor) {
46 38 : if (getCEPS().find(Helper->getgClass()) == getCEPS().end()) {
47 38 : if (!Load(DataPath, Helper, DataCor)) {
48 0 : return false;
49 : }
50 : }
51 : return true;
52 : }
53 :
54 8 : bool CEPHandler::CalcCorrection(Correction* DataCor, Helpers* Helper, VEHPHEMLightJSON::Vehicle_Data* vehicle_Data) {
55 8 : if (DataCor->getUseDet()) {
56 4 : DataCor->setVehMileage(-1);
57 4 : if (vehicle_Data->getMileage() > 0.) {
58 0 : DataCor->setVehMileage(vehicle_Data->getMileage());
59 : }
60 :
61 4 : if (!DataCor->IniDETfactor(Helper)) {
62 : return false;
63 : }
64 : }
65 8 : if (DataCor->getUseTNOx()) {
66 4 : if (!DataCor->IniTNOxfactor(Helper)) {
67 0 : return false;
68 : }
69 : }
70 :
71 : //Return value
72 : return true;
73 : }
74 :
75 38 : bool CEPHandler::Load(std::vector<std::string>& DataPath, Helpers* Helper, Correction* DataCor, bool fleetMix) {
76 : //Deklaration
77 : // get string identifier for PHEM emission class
78 38 : std::string emissionRep = Helper->getgClass();
79 :
80 : // to hold everything.
81 : std::vector<std::vector<double> > matrixFCvalues;
82 : std::vector<std::vector<double> > matrixPollutants;
83 : std::vector<double> idlingValuesFCvalues;
84 : std::vector<double> idlingValuesPollutants;
85 : std::vector<std::string> headerFCvalues;
86 : std::vector<std::string> headerPollutants;
87 : VEHPHEMLightJSON::VEH* Vehicle;
88 :
89 38 : if (!ReadVehicleFile(DataPath, emissionRep, Helper, fleetMix, Vehicle)) {
90 0 : delete Vehicle;
91 0 : return false;
92 : }
93 :
94 38 : if (DataCor != nullptr) {
95 8 : if (!CalcCorrection(DataCor, Helper, Vehicle->getVehicleData())) {
96 0 : delete Vehicle;
97 0 : return false;
98 : }
99 : }
100 :
101 38 : if (!ReadEmissionData(true, DataPath, emissionRep, Helper, fleetMix, DataCor, headerFCvalues, matrixFCvalues, idlingValuesFCvalues)) {
102 0 : delete Vehicle;
103 0 : return false;
104 : }
105 38 : if (!ReadEmissionData(false, DataPath, emissionRep, Helper, fleetMix, DataCor, headerPollutants, matrixPollutants, idlingValuesPollutants)) {
106 0 : delete Vehicle;
107 0 : return false;
108 : }
109 :
110 38 : _ceps.insert(std::make_pair(Helper->getgClass(), new CEP(Vehicle, headerFCvalues, matrixFCvalues, headerPollutants, matrixPollutants, idlingValuesFCvalues, idlingValuesPollutants)));
111 38 : delete Vehicle;
112 : return true;
113 76 : }
114 :
115 836 : double json2double(const nlohmann::json& vd, const std::string& key) {
116 : if (vd.contains(key)) {
117 1596 : return vd.at(key).get<double>();
118 : }
119 : return 0.;
120 : }
121 :
122 38 : bool CEPHandler::ReadVehicleFile(const std::vector<std::string>& DataPath, const std::string& emissionClass, Helpers* Helper, bool /* fleetMix */, VEHPHEMLightJSON::VEH*& Vehicle) {
123 38 : std::string path = "";
124 38 : Vehicle = new VEHPHEMLightJSON::VEH();
125 :
126 : //Open file
127 38 : std::ifstream vehicleReader;
128 76 : for (std::vector<std::string>::const_iterator i = DataPath.begin(); i != DataPath.end(); i++) {
129 152 : vehicleReader.open(((*i) + emissionClass + ".PHEMLight.veh").c_str());
130 76 : if (vehicleReader.good()) {
131 : break;
132 : }
133 : }
134 38 : if (!vehicleReader.good()) {
135 0 : Helper->setErrMsg("File does not exist! (" + emissionClass + ".PHEMLight.veh)");
136 0 : return false;
137 : }
138 :
139 : //**** VEH Datei einlesen ****
140 : nlohmann::json json;
141 : try {
142 38 : vehicleReader >> json;
143 0 : } catch (...) {
144 0 : Helper->setErrMsg("Error during file read! (" + emissionClass + ".PHEMLight.veh)");
145 : return false;
146 0 : }
147 :
148 : //*** Get the vehicle data
149 38 : nlohmann::json::iterator vehDataIt = json.find("VehicleData");
150 38 : if (vehDataIt == json.end()) {
151 0 : Helper->setErrMsg("No VehicleData in " + emissionClass + ".PHEMLight.veh!");
152 0 : return false;
153 : }
154 38 : const nlohmann::json& vd = *vehDataIt;
155 152 : Vehicle->getVehicleData()->setMassType(vd.contains("MassType") ? vd.at("MassType").get<std::string>() : "LV");
156 152 : Vehicle->getVehicleData()->setFuelType(vd.contains("FuelType") ? vd.at("FuelType").get<std::string>() : "D");
157 152 : Vehicle->getVehicleData()->setCalcType(vd.contains("CalcType") ? vd.at("CalcType").get<std::string>() : "Conv");
158 38 : Vehicle->getVehicleData()->setMass(json2double(vd, "Mass"));
159 38 : Vehicle->getVehicleData()->setLoading(json2double(vd, "Loading"));
160 38 : Vehicle->getVehicleData()->setRedMassWheel(json2double(vd, "RedMassWheel"));
161 38 : Vehicle->getVehicleData()->setWheelDiameter(json2double(vd, "WheelDiameter"));
162 38 : Vehicle->getVehicleData()->setCw(json2double(vd, "Cw"));
163 38 : Vehicle->getVehicleData()->setA(json2double(vd, "A"));
164 38 : Vehicle->getVehicleData()->setMileage(json2double(vd, "Mileage"));
165 :
166 : // Auxiliaries
167 38 : nlohmann::json::iterator auxDataIt = json.find("AuxiliariesData");
168 38 : if (auxDataIt == json.end() || !auxDataIt->contains("Pauxnorm")) {
169 0 : Vehicle->getAuxiliariesData()->setPauxnorm(0.);
170 : } else {
171 76 : Vehicle->getAuxiliariesData()->setPauxnorm(auxDataIt->at("Pauxnorm").get<double>());
172 : }
173 :
174 : // Engine Data
175 38 : nlohmann::json::iterator engDataIt = json.find("EngineData");
176 76 : if (engDataIt == json.end() || !engDataIt->contains("ICEData") || !engDataIt->contains("EMData")) {
177 0 : Helper->setErrMsg("Incomplete EngineData in " + emissionClass + ".PHEMLight.veh!");
178 0 : return false;
179 : }
180 38 : const nlohmann::json& iced = (*engDataIt)["ICEData"];
181 38 : const nlohmann::json& emd = (*engDataIt)["EMData"];
182 38 : Vehicle->getEngineData()->getICEData()->setPrated(json2double(iced, "Prated"));
183 38 : Vehicle->getEngineData()->getICEData()->setnrated(json2double(iced, "nrated"));
184 38 : Vehicle->getEngineData()->getICEData()->setIdling(json2double(iced, "Idling"));
185 38 : Vehicle->getEngineData()->getEMData()->setPrated(json2double(emd, "Prated"));
186 38 : Vehicle->getEngineData()->getEMData()->setnrated(json2double(emd, "nrated"));
187 :
188 : // Rolling resistance
189 38 : nlohmann::json::iterator rrDataIt = json.find("RollingResData");
190 38 : if (rrDataIt == json.end()) {
191 0 : Helper->setErrMsg("No RollingResData in " + emissionClass + ".PHEMLight.veh!");
192 0 : return false;
193 : }
194 38 : const nlohmann::json& rrd = *rrDataIt;
195 38 : Vehicle->getRollingResData()->setFr0(json2double(rrd, "Fr0"));
196 38 : Vehicle->getRollingResData()->setFr1(json2double(rrd, "Fr1"));
197 38 : Vehicle->getRollingResData()->setFr2(json2double(rrd, "Fr2"));
198 38 : Vehicle->getRollingResData()->setFr3(json2double(rrd, "Fr3"));
199 38 : Vehicle->getRollingResData()->setFr4(json2double(rrd, "Fr4"));
200 :
201 : // Transmission
202 38 : nlohmann::json::iterator trDataIt = json.find("TransmissionData");
203 38 : if (trDataIt == json.end()) {
204 0 : Helper->setErrMsg("No TransmissionData in " + emissionClass + ".PHEMLight.veh!");
205 0 : return false;
206 : }
207 38 : Vehicle->getTransmissionData()->setAxelRatio(json2double(*trDataIt, "AxelRatio"));
208 38 : nlohmann::json::iterator transmIt = trDataIt->find("Transm");
209 38 : if (transmIt == trDataIt->end()) {
210 0 : Helper->setErrMsg(std::string("Transmission ratios missing in vehicle file! Calculation stopped! (") + path + std::string(")"));
211 0 : return false;
212 : } else {
213 38 : if (!transmIt->contains("Speed")) {
214 0 : Helper->setErrMsg(std::string("No Speed signal in transmission data given! Calculation stopped! (") + path + std::string(")"));
215 0 : return false;
216 : }
217 38 : if (!transmIt->contains("GearRatio")) {
218 0 : Helper->setErrMsg(std::string("No GearRatio signal in transmission data given! Calculation stopped! (") + path + std::string(")"));
219 0 : return false;
220 : }
221 38 : if (!transmIt->contains("RotMassF")) {
222 0 : Helper->setErrMsg(std::string("No RotMassF signal in transmission data given! Calculation stopped! (") + path + std::string(")"));
223 0 : return false;
224 : }
225 : }
226 76 : Vehicle->getTransmissionData()->setTransm(transmIt->get<std::map<std::string, std::vector<double> > >());
227 :
228 : // Full load and drag
229 38 : nlohmann::json::iterator fldDataIt = json.find("FLDData");
230 38 : if (fldDataIt == json.end()) {
231 0 : Helper->setErrMsg("No FLDData in " + emissionClass + ".PHEMLight.veh!");
232 0 : return false;
233 : }
234 38 : const nlohmann::json& fld = *fldDataIt;
235 38 : Vehicle->getFLDData()->setP_n_max_v0(json2double(fld, "P_n_max_v0"));
236 38 : Vehicle->getFLDData()->setP_n_max_p0(json2double(fld, "P_n_max_p0"));
237 38 : Vehicle->getFLDData()->setP_n_max_v1(json2double(fld, "P_n_max_v1"));
238 38 : Vehicle->getFLDData()->setP_n_max_p1(json2double(fld, "P_n_max_p1"));
239 38 : nlohmann::json::iterator dragIt = fldDataIt->find("DragCurve");
240 38 : if (dragIt == fldDataIt->end()) {
241 0 : Helper->setErrMsg(std::string("Drag curve missing in vehicle file! Calculation stopped! (") + path + std::string(")"));
242 0 : return false;
243 : } else {
244 38 : if (!dragIt->contains("n_norm")) {
245 0 : Helper->setErrMsg(std::string("No n_norm signal in drag curve data given! Calculation stopped! (") + path + std::string(")"));
246 0 : return false;
247 : }
248 38 : if (!dragIt->contains("pe_drag_norm")) {
249 0 : Helper->setErrMsg(std::string("No pe_drag_norm signal in drag curve data given! Calculation stopped! (") + path + std::string(")"));
250 0 : return false;
251 : }
252 : }
253 76 : Vehicle->getFLDData()->setDragCurve(dragIt->get<std::map<std::string, std::vector<double> > >());
254 :
255 38 : return true;
256 38 : }
257 :
258 76 : bool CEPHandler::ReadEmissionData(bool readFC, const std::vector<std::string>& DataPath, const std::string& emissionClass, Helpers* Helper, bool /* fleetMix */, Correction* DataCor, std::vector<std::string>& header, std::vector<std::vector<double> >& matrix, std::vector<double>& idlingValues) {
259 : // declare file stream
260 : std::string line;
261 76 : std::string path = "";
262 76 : header = std::vector<std::string>();
263 76 : matrix = std::vector<std::vector<double> >();
264 76 : idlingValues = std::vector<double>();
265 :
266 76 : std::string pollutantExtension = "";
267 76 : if (readFC) {
268 76 : pollutantExtension += std::string("_FC");
269 : }
270 :
271 76 : std::ifstream fileReader;
272 152 : for (std::vector<std::string>::const_iterator i = DataPath.begin(); i != DataPath.end(); i++) {
273 304 : fileReader.open(((*i) + emissionClass + pollutantExtension + ".csv").c_str());
274 152 : if (fileReader.good()) {
275 : break;
276 : }
277 : }
278 76 : if (!fileReader.good()) {
279 0 : Helper->setErrMsg("File does not exist! (" + emissionClass + pollutantExtension + ".csv)");
280 0 : return false;
281 : }
282 :
283 : // read header line for pollutant identifiers
284 152 : if ((line = ReadLine(fileReader)) != "") {
285 76 : const std::vector<std::string>& entries = split(line, ',');
286 : // skip first entry "Pe"
287 380 : for (int i = 1; i < (int)entries.size(); i++) {
288 304 : header.push_back(entries[i]);
289 : }
290 76 : }
291 :
292 : // skip units
293 76 : ReadLine(fileReader);
294 :
295 : // skip comment
296 76 : ReadLine(fileReader);
297 :
298 : //readIdlingValues
299 76 : line = ReadLine(fileReader);
300 :
301 76 : std::vector<std::string> stringIdlings = split(line, ',');
302 : stringIdlings.erase(stringIdlings.begin());
303 :
304 76 : idlingValues = todoubleList(stringIdlings);
305 :
306 3496 : while ((line = ReadLine(fileReader)) != "") {
307 3344 : matrix.push_back(todoubleList(split(line, ',')));
308 : }
309 :
310 : //Data correction (Det & TNOx)
311 76 : if (!CorrectEmissionData(DataCor, header, matrix, idlingValues)) {
312 0 : Helper->setErrMsg("Error in correction calculation");
313 0 : return false;
314 : }
315 :
316 : //Return value
317 : return true;
318 76 : }
319 :
320 76 : bool CEPHandler::CorrectEmissionData(Correction* DataCor, std::vector<std::string>& header, std::vector<std::vector<double> >& matrix, std::vector<double>& idlingValues) {
321 380 : for (int i = 0; i < (int)header.size(); i++) {
322 304 : double CorF = GetDetTempCor(DataCor, header[i]);
323 304 : if (CorF != 1) {
324 128 : for (int j = 0; j < (int)matrix.size(); j++) {
325 124 : matrix[j][i + 1] *= CorF;
326 : }
327 4 : idlingValues[i] *= CorF;
328 : }
329 : }
330 :
331 : //Return value
332 76 : return true;
333 : }
334 :
335 304 : double CEPHandler::GetDetTempCor(Correction* DataCor, const std::string& Emi) {
336 : //Initialisation
337 : double CorF = 1;
338 : std::string emi = Emi;
339 798 : std::transform(emi.begin(), emi.end(), emi.begin(), [](char c) { return (char)::toupper(c); });
340 :
341 304 : if (DataCor != 0) {
342 64 : if (DataCor->getUseDet() && DataCor->DETFactors.count(emi) > 0) {
343 12 : CorF += DataCor->DETFactors[emi] - 1;
344 : }
345 64 : if (DataCor->getUseTNOx()) {
346 32 : if (emi.find("NOX") != std::string::npos) {
347 4 : CorF += (DataCor->getTNOxFactor() - 1);
348 : }
349 : }
350 : }
351 :
352 : //Return value
353 304 : return CorF;
354 : }
355 :
356 1824 : const std::vector<std::string> CEPHandler::split(const std::string& s, char delim) {
357 : std::vector<std::string> elems;
358 1824 : std::stringstream ss(s);
359 : std::string item;
360 11628 : while (std::getline(ss, item, delim)) {
361 9804 : elems.push_back(item);
362 : }
363 1824 : return elems;
364 1824 : }
365 :
366 9348 : double CEPHandler::todouble(const std::string& s) {
367 9348 : std::stringstream ss(s);
368 : double item;
369 : ss >> item;
370 9348 : return item;
371 9348 : }
372 :
373 1748 : std::vector<double> CEPHandler::todoubleList(const std::vector<std::string>& s) {
374 : std::vector<double> result;
375 11096 : for (std::vector<std::string>::const_iterator i = s.begin(); i != s.end(); ++i) {
376 9348 : result.push_back(todouble(*i));
377 : }
378 1748 : return result;
379 : }
380 :
381 2052 : std::string CEPHandler::ReadLine(std::ifstream& s) {
382 : std::string line;
383 2052 : std::getline(s, line);
384 : size_t lastNWChar = line.find_last_not_of(" \n\r\t");
385 2052 : if (lastNWChar != std::string::npos) {
386 1976 : line.erase(lastNWChar + 1);
387 : }
388 2052 : return line;
389 : }
390 :
391 0 : const std::string& VEHPHEMLightJSON::VEH::getType() const {
392 0 : return privateType;
393 : }
394 :
395 0 : void VEHPHEMLightJSON::VEH::setType(const std::string& value) {
396 0 : privateType = value;
397 0 : }
398 :
399 0 : const std::string& VEHPHEMLightJSON::VEH::getVersion() const {
400 0 : return privateVersion;
401 : }
402 :
403 0 : void VEHPHEMLightJSON::VEH::setVersion(const std::string& value) {
404 0 : privateVersion = value;
405 0 : }
406 :
407 730 : VEHPHEMLightJSON::Vehicle_Data* VEHPHEMLightJSON::VEH::getVehicleData() {
408 730 : return &privateVehicleData;
409 : }
410 :
411 76 : VEHPHEMLightJSON::Aux_Data* VEHPHEMLightJSON::VEH::getAuxiliariesData() {
412 76 : return &privateAuxiliariesData;
413 : }
414 :
415 304 : VEHPHEMLightJSON::Engine_Data* VEHPHEMLightJSON::VEH::getEngineData() {
416 304 : return &privateEngineData;
417 : }
418 :
419 380 : VEHPHEMLightJSON::Rollres_Data* VEHPHEMLightJSON::VEH::getRollingResData() {
420 380 : return &privateRollingResData;
421 : }
422 :
423 418 : VEHPHEMLightJSON::FullLoadDrag_Data* VEHPHEMLightJSON::VEH::getFLDData() {
424 418 : return &privateFLDData;
425 : }
426 :
427 792 : VEHPHEMLightJSON::Transmission_Data* VEHPHEMLightJSON::VEH::getTransmissionData() {
428 792 : return &privateTransmissionData;
429 : }
430 :
431 38 : const std::string& VEHPHEMLightJSON::Vehicle_Data::getMassType() const {
432 38 : return privateMassType;
433 : }
434 :
435 38 : void VEHPHEMLightJSON::Vehicle_Data::setMassType(const std::string& value) {
436 38 : privateMassType = value;
437 38 : }
438 :
439 38 : const std::string& VEHPHEMLightJSON::Vehicle_Data::getFuelType() const {
440 38 : return privateFuelType;
441 : }
442 :
443 38 : void VEHPHEMLightJSON::Vehicle_Data::setFuelType(const std::string& value) {
444 38 : privateFuelType = value;
445 38 : }
446 :
447 38 : const std::string& VEHPHEMLightJSON::Vehicle_Data::getCalcType() const {
448 38 : return privateCalcType;
449 : }
450 :
451 38 : void VEHPHEMLightJSON::Vehicle_Data::setCalcType(const std::string& value) {
452 38 : privateCalcType = value;
453 38 : }
454 :
455 38 : const double& VEHPHEMLightJSON::Vehicle_Data::getMass() const {
456 38 : return privateMass;
457 : }
458 :
459 38 : void VEHPHEMLightJSON::Vehicle_Data::setMass(const double& value) {
460 38 : privateMass = value;
461 38 : }
462 :
463 38 : const double& VEHPHEMLightJSON::Vehicle_Data::getLoading() const {
464 38 : return privateLoading;
465 : }
466 :
467 38 : void VEHPHEMLightJSON::Vehicle_Data::setLoading(const double& value) {
468 38 : privateLoading = value;
469 38 : }
470 :
471 38 : const double& VEHPHEMLightJSON::Vehicle_Data::getRedMassWheel() const {
472 38 : return privateRedMassWheel;
473 : }
474 :
475 38 : void VEHPHEMLightJSON::Vehicle_Data::setRedMassWheel(const double& value) {
476 38 : privateRedMassWheel = value;
477 38 : }
478 :
479 38 : const double& VEHPHEMLightJSON::Vehicle_Data::getWheelDiameter() const {
480 38 : return privateWheelDiameter;
481 : }
482 :
483 38 : void VEHPHEMLightJSON::Vehicle_Data::setWheelDiameter(const double& value) {
484 38 : privateWheelDiameter = value;
485 38 : }
486 :
487 38 : const double& VEHPHEMLightJSON::Vehicle_Data::getCw() const {
488 38 : return privateCw;
489 : }
490 :
491 38 : void VEHPHEMLightJSON::Vehicle_Data::setCw(const double& value) {
492 38 : privateCw = value;
493 38 : }
494 :
495 38 : const double& VEHPHEMLightJSON::Vehicle_Data::getA() const {
496 38 : return privateA;
497 : }
498 :
499 38 : void VEHPHEMLightJSON::Vehicle_Data::setA(const double& value) {
500 38 : privateA = value;
501 38 : }
502 :
503 4 : const double& VEHPHEMLightJSON::Vehicle_Data::getMileage() const {
504 4 : return privateMileage;
505 : }
506 :
507 38 : void VEHPHEMLightJSON::Vehicle_Data::setMileage(const double& value) {
508 38 : privateMileage = value;
509 38 : }
510 :
511 38 : const double& VEHPHEMLightJSON::Rollres_Data::getFr0() const {
512 38 : return privateFr0;
513 : }
514 :
515 38 : void VEHPHEMLightJSON::Rollres_Data::setFr0(const double& value) {
516 38 : privateFr0 = value;
517 38 : }
518 :
519 38 : const double& VEHPHEMLightJSON::Rollres_Data::getFr1() const {
520 38 : return privateFr1;
521 : }
522 :
523 38 : void VEHPHEMLightJSON::Rollres_Data::setFr1(const double& value) {
524 38 : privateFr1 = value;
525 38 : }
526 :
527 38 : const double& VEHPHEMLightJSON::Rollres_Data::getFr2() const {
528 38 : return privateFr2;
529 : }
530 :
531 38 : void VEHPHEMLightJSON::Rollres_Data::setFr2(const double& value) {
532 38 : privateFr2 = value;
533 38 : }
534 :
535 38 : const double& VEHPHEMLightJSON::Rollres_Data::getFr3() const {
536 38 : return privateFr3;
537 : }
538 :
539 38 : void VEHPHEMLightJSON::Rollres_Data::setFr3(const double& value) {
540 38 : privateFr3 = value;
541 38 : }
542 :
543 38 : const double& VEHPHEMLightJSON::Rollres_Data::getFr4() const {
544 38 : return privateFr4;
545 : }
546 :
547 38 : void VEHPHEMLightJSON::Rollres_Data::setFr4(const double& value) {
548 38 : privateFr4 = value;
549 38 : }
550 :
551 228 : VEHPHEMLightJSON::ICE_Data* VEHPHEMLightJSON::Engine_Data::getICEData() {
552 228 : return &privateICEData;
553 : }
554 :
555 76 : VEHPHEMLightJSON::EM_Data* VEHPHEMLightJSON::Engine_Data::getEMData() {
556 76 : return &privateEMData;
557 : }
558 :
559 38 : const double& VEHPHEMLightJSON::ICE_Data::getPrated() const {
560 38 : return privatePrated;
561 : }
562 :
563 38 : void VEHPHEMLightJSON::ICE_Data::setPrated(const double& value) {
564 38 : privatePrated = value;
565 38 : }
566 :
567 38 : const double& VEHPHEMLightJSON::ICE_Data::getnrated() const {
568 38 : return privatenrated;
569 : }
570 :
571 38 : void VEHPHEMLightJSON::ICE_Data::setnrated(const double& value) {
572 38 : privatenrated = value;
573 38 : }
574 :
575 38 : const double& VEHPHEMLightJSON::ICE_Data::getIdling() const {
576 38 : return privateIdling;
577 : }
578 :
579 38 : void VEHPHEMLightJSON::ICE_Data::setIdling(const double& value) {
580 38 : privateIdling = value;
581 38 : }
582 :
583 0 : const double& VEHPHEMLightJSON::EM_Data::getPrated() const {
584 0 : return privatePrated;
585 : }
586 :
587 38 : void VEHPHEMLightJSON::EM_Data::setPrated(const double& value) {
588 38 : privatePrated = value;
589 38 : }
590 :
591 0 : const double& VEHPHEMLightJSON::EM_Data::getnrated() const {
592 0 : return privatenrated;
593 : }
594 :
595 38 : void VEHPHEMLightJSON::EM_Data::setnrated(const double& value) {
596 38 : privatenrated = value;
597 38 : }
598 :
599 38 : const double& VEHPHEMLightJSON::Aux_Data::getPauxnorm() const {
600 38 : return privatePauxnorm;
601 : }
602 :
603 38 : void VEHPHEMLightJSON::Aux_Data::setPauxnorm(const double& value) {
604 38 : privatePauxnorm = value;
605 38 : }
606 :
607 38 : const double& VEHPHEMLightJSON::FullLoadDrag_Data::getP_n_max_v0() const {
608 38 : return privateP_n_max_v0;
609 : }
610 :
611 38 : void VEHPHEMLightJSON::FullLoadDrag_Data::setP_n_max_v0(const double& value) {
612 38 : privateP_n_max_v0 = value;
613 38 : }
614 :
615 38 : const double& VEHPHEMLightJSON::FullLoadDrag_Data::getP_n_max_p0() const {
616 38 : return privateP_n_max_p0;
617 : }
618 :
619 38 : void VEHPHEMLightJSON::FullLoadDrag_Data::setP_n_max_p0(const double& value) {
620 38 : privateP_n_max_p0 = value;
621 38 : }
622 :
623 38 : const double& VEHPHEMLightJSON::FullLoadDrag_Data::getP_n_max_v1() const {
624 38 : return privateP_n_max_v1;
625 : }
626 :
627 38 : void VEHPHEMLightJSON::FullLoadDrag_Data::setP_n_max_v1(const double& value) {
628 38 : privateP_n_max_v1 = value;
629 38 : }
630 :
631 38 : const double& VEHPHEMLightJSON::FullLoadDrag_Data::getP_n_max_p1() const {
632 38 : return privateP_n_max_p1;
633 : }
634 :
635 38 : void VEHPHEMLightJSON::FullLoadDrag_Data::setP_n_max_p1(const double& value) {
636 38 : privateP_n_max_p1 = value;
637 38 : }
638 :
639 76 : std::map<std::string, std::vector<double> >& VEHPHEMLightJSON::FullLoadDrag_Data::getDragCurve() {
640 76 : return privateDragCurve;
641 : }
642 :
643 76 : void VEHPHEMLightJSON::FullLoadDrag_Data::setDragCurve(const std::map<std::string, std::vector<double> >& value) {
644 : privateDragCurve = value;
645 76 : }
646 :
647 38 : VEHPHEMLightJSON::FullLoadDrag_Data::FullLoadDrag_Data() {
648 38 : setDragCurve(std::map<std::string, std::vector<double> >());
649 38 : }
650 :
651 38 : const double& VEHPHEMLightJSON::Transmission_Data::getAxelRatio() const {
652 38 : return privateAxelRatio;
653 : }
654 :
655 38 : void VEHPHEMLightJSON::Transmission_Data::setAxelRatio(const double& value) {
656 38 : privateAxelRatio = value;
657 38 : }
658 :
659 678 : std::map<std::string, std::vector<double> >& VEHPHEMLightJSON::Transmission_Data::getTransm() {
660 678 : return privateTransm;
661 : }
662 :
663 76 : void VEHPHEMLightJSON::Transmission_Data::setTransm(const std::map<std::string, std::vector<double> >& value) {
664 : privateTransm = value;
665 76 : }
666 :
667 38 : VEHPHEMLightJSON::Transmission_Data::Transmission_Data() {
668 38 : setTransm(std::map<std::string, std::vector<double> >());
669 38 : }
670 : }
|