SUMO - Simulation of Urban MObility
MSSOTLPolicyDesirability.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The class a low-level policy desirability
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2013-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 #ifndef MSSOTLPOLICYDESIRABILITY_H_
22 #define MSSOTLPOLICYDESIRABILITY_H_
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
34 #include <sstream>
37 
44 
45 private:
46  std::string myKeyPrefix;
47 
48 protected:
49  double readParameter(std::string parName, double defValue) {
50  return TplConvert::_2doubleSec(getParameter(parName, "").c_str(), defValue);
51  }
52 
53 public:
54 
55  MSSOTLPolicyDesirability(std::string keyPrefix,
56  const std::map<std::string, std::string>& parameters);
57  virtual ~MSSOTLPolicyDesirability();
58 
62  virtual double computeDesirability(double vehInMeasure,
63  double vehOutMeasure) = 0;
67  virtual double computeDesirability(double vehInMeasure, double vehOutMeasure,
68  double vehInDispersionMeasure,
69  double vehOutDispersionMeasure) = 0;
70  virtual std::string getMessage() = 0;
71  void setKeyPrefix(std::string val) {
72  myKeyPrefix = val;
73  }
74  std::string getKeyPrefix() {
75  return myKeyPrefix;
76  }
77 
78 };
79 
80 #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:355
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:51
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)