/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2016-2025 German Aerospace Center (DLR) and others.3// PHEMlight module4// Copyright 2016 Technische Universitaet Graz, https://www.tugraz.at/5// This program and the accompanying materials are made available under the6// terms of the Eclipse Public License 2.0 which is available at7// https://www.eclipse.org/legal/epl-2.0/8// This Source Code may also be made available under the following Secondary9// Licenses when the conditions for such availability set forth in the Eclipse10// Public License 2.0 are satisfied: GNU General Public License, version 211// or later which is available at12// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html13// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later14/****************************************************************************/15/// @file CEPHandler.h16/// @author Martin Dippold17/// @author Michael Behrisch18/// @date July 201619///20//21/****************************************************************************/222324#ifndef PHEMlightCEPHANDLER25#define PHEMlightCEPHANDLER2627#include <string>28#include <map>29#include <vector>30#include <utility>3132//C# TO C++ CONVERTER NOTE: Forward class declarations:33namespace PHEMlightdll { class CEP; }34namespace PHEMlightdll { class Helpers; }353637namespace PHEMlightdll {38class CEPHandler {39//--------------------------------------------------------------------------------------------------40// Constructors41//--------------------------------------------------------------------------------------------------4243public:44CEPHandler();4546//--------------------------------------------------------------------------------------------------47// Members48//--------------------------------------------------------------------------------------------------4950private:51std::map<std::string, CEP*> _ceps;52public:53const std::map<std::string, CEP*>& getCEPS() const;545556//--------------------------------------------------------------------------------------------------57// Methods58//--------------------------------------------------------------------------------------------------5960bool GetCEP(const std::vector<std::string>& DataPath, Helpers* Helper);616263//--------------------------------------------------------------------------------------------------64// Methods65//--------------------------------------------------------------------------------------------------6667private:68bool Load(const std::vector<std::string>& DataPath, Helpers* Helper);6970bool ReadVehicleFile(const std::vector<std::string>& DataPath, const std::string& emissionClass, Helpers* Helper, double& vehicleMass, double& vehicleLoading, double& vehicleMassRot, double& crossArea, double& cWValue, double& f0, double& f1, double& f2, double& f3, double& f4, double& axleRatio, double& auxPower, double& ratedPower, double& engineIdlingSpeed, double& engineRatedSpeed, double& effectiveWheelDiameter, std::vector<double>& transmissionGearRatios, std::string& vehicleMassType, std::string& vehicleFuelType, double& pNormV0, double& pNormP0, double& pNormV1, double& pNormP1, std::vector<std::vector<double> >& matrixSpeedInertiaTable, std::vector<std::vector<double> >& normedDragTable);7172bool ReadEmissionData(bool readFC, const std::vector<std::string>& DataPath, const std::string& emissionClass, Helpers* Helper, std::vector<std::string>& header, std::vector<std::vector<double> >& matrix, std::vector<double>& idlingValues);737475//--------------------------------------------------------------------------------------------------76// Functions77//--------------------------------------------------------------------------------------------------7879//Split the string80std::vector<std::string> split(const std::string& s, char delim);8182//Convert string to double83double todouble(const std::string& s);8485//Convert string to double list86std::vector<double> todoubleList(const std::vector<std::string>& s);8788//Read a line from file89std::string ReadLine(std::ifstream& s);90};91}929394#endif //#ifndef PHEMlightCEPHANDLER959697