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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // The class a low-level policy desirability
18 /****************************************************************************/
19 
20 #ifndef MSSOTLPOLICYDESIRABILITY_H_
21 #define MSSOTLPOLICYDESIRABILITY_H_
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
33 #include <sstream>
36 
43 
44 private:
45  std::string myKeyPrefix;
46 
47 protected:
48  double readParameter(std::string parName, double defValue) {
49  return TplConvert::_2doubleSec(getParameter(parName, "").c_str(), defValue);
50  }
51 
52 public:
53 
54  MSSOTLPolicyDesirability(std::string keyPrefix,
55  const std::map<std::string, std::string>& parameters);
56  virtual ~MSSOTLPolicyDesirability();
57 
61  virtual double computeDesirability(double vehInMeasure,
62  double vehOutMeasure) = 0;
66  virtual double computeDesirability(double vehInMeasure, double vehOutMeasure,
67  double vehInDispersionMeasure,
68  double vehOutDispersionMeasure) = 0;
69  virtual std::string getMessage() = 0;
70  void setKeyPrefix(std::string val) {
71  myKeyPrefix = val;
72  }
73  std::string getKeyPrefix() {
74  return myKeyPrefix;
75  }
76 
77 };
78 
79 #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:371
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:50
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)