SUMO - Simulation of Urban MObility
MSSOTLPolicyDesirability.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2013-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The class a low-level policy desirability
16 /****************************************************************************/
17 
18 #ifndef MSSOTLPOLICYDESIRABILITY_H_
19 #define MSSOTLPOLICYDESIRABILITY_H_
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
27 #include <sstream>
30 
37 
38 private:
39  std::string myKeyPrefix;
40 
41 protected:
42  double readParameter(std::string parName, double defValue) {
43  return TplConvert::_2doubleSec(getParameter(parName, "").c_str(), defValue);
44  }
45 
46 public:
47 
48  MSSOTLPolicyDesirability(std::string keyPrefix,
49  const std::map<std::string, std::string>& parameters);
50  virtual ~MSSOTLPolicyDesirability();
51 
55  virtual double computeDesirability(double vehInMeasure,
56  double vehOutMeasure) = 0;
60  virtual double computeDesirability(double vehInMeasure, double vehOutMeasure,
61  double vehInDispersionMeasure,
62  double vehOutDispersionMeasure) = 0;
63  virtual std::string getMessage() = 0;
64  void setKeyPrefix(std::string val) {
65  myKeyPrefix = val;
66  }
67  std::string getKeyPrefix() {
68  return myKeyPrefix;
69  }
70 
71 };
72 
73 #endif /* MSSOTLPOLICYDESIRABILITY_H_ */
virtual std::string getMessage()=0
static double _2doubleSec(const E *const data, double def)
converts a 0-terminated char-type array into the double value described by it
Definition: TplConvert.h:365
virtual double computeDesirability(double vehInMeasure, double vehOutMeasure)=0
Calculates the desirability of the policy.
void setKeyPrefix(std::string val)
MSSOTLPolicyDesirability(std::string keyPrefix, const std::map< std::string, std::string > &parameters)
An upper class for objects with additional parameters.
Definition: Parameterised.h:44
This class determines the desirability algorithm of a MSSOTLPolicy when used in combination with a hi...
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
double readParameter(std::string parName, double defValue)