Eclipse SUMO - Simulation of Urban MObility
EnergyParams.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // A class for parameters used by the emission models
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 #include <map>
23 #include <string>
24 #include <vector>
27 
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 class SUMOVTypeParameter;
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
41 class EnergyParams {
42 
43 public:
45  EnergyParams(const SUMOVTypeParameter* typeParams = nullptr);
46 
48  ~EnergyParams();
49 
54  void setDouble(SumoXMLAttr attr, double value);
55 
56  double getDouble(SumoXMLAttr attr) const;
57 
62  const std::vector<double>& getDoubles(SumoXMLAttr attr) const;
63 
71 
72  bool knowsParameter(SumoXMLAttr attr) const;
73 
74 private:
75 
77  std::map<SumoXMLAttr, double> myMap;
78  std::map<SumoXMLAttr, std::vector<double> > myVecMap;
79  std::map<SumoXMLAttr, CharacteristicMap> myCharacteristicMapMap;
80 };
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
The purpose of this class is to store a characteristic map (German: Kennfeld) of arbitrary dimensions...
An upper class for objects with additional parameters.
Definition: EnergyParams.h:41
double getDouble(SumoXMLAttr attr) const
bool knowsParameter(SumoXMLAttr attr) const
void setDouble(SumoXMLAttr attr, double value)
Sets a parameter.
std::map< SumoXMLAttr, double > myMap
The key->value maps.
Definition: EnergyParams.h:77
EnergyParams(const SUMOVTypeParameter *typeParams=nullptr)
Default constructor.
std::map< SumoXMLAttr, std::vector< double > > myVecMap
Definition: EnergyParams.h:78
std::map< SumoXMLAttr, CharacteristicMap > myCharacteristicMapMap
Definition: EnergyParams.h:79
const CharacteristicMap & getCharacteristicMap(SumoXMLAttr attr) const
Return the CharacteristicMap that belongs to a given attribute.
~EnergyParams()
Destructor.
const std::vector< double > & getDoubles(SumoXMLAttr attr) const
Returns the value for a given key.
Structure representing possible vehicle parameter.