Eclipse SUMO - Simulation of Urban MObility
MSSOTLPolicy5DStimulus.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-2019 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 /****************************************************************************/
16 // The class the low-level policy stimulus
17 /****************************************************************************/
18 
19 #ifndef MSSOTLPOLICY5DSTIMULUS_H_
20 #define MSSOTLPOLICY5DSTIMULUS_H_
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 //#define SWARM_DEBUG
30 #include <sstream>
31 #include <cmath>
33 
42 
43 private:
44 
45  double stimCoxDVal,
49 
50 public:
51 
52  MSSOTLPolicy5DStimulus(std::string keyPrefix, const std::map<std::string, std::string>& parameters);
53 
54  double getStimCox() {
55  std::string key = getKeyPrefix() + "_STIM_COX";
56  return getDouble(key, stimCoxDVal);
57  }
58  void setStimCoxDefVal(double defVal) {
59  stimCoxDVal = defVal;
60  }
61  double getStimOffsetIn() {
62  std::string key = getKeyPrefix() + "_STIM_OFFSET_IN";
63  return getDouble(key, stimOffsetInDVal);
64  }
65  void setStimOffsetInDefVal(double defVal) {
66  stimOffsetInDVal = defVal;
67  }
68  double getStimOffsetOut() {
69  std::string key = getKeyPrefix() + "_STIM_OFFSET_OUT";
70  return getDouble(key, stimOffsetOutDVal);
71  }
72 
73  void setStimOffsetOutDefVal(double defVal) {
74  stimOffsetOutDVal = defVal;
75  }
76 
78  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_IN";
79  return getDouble(key, stimOffsetDispersionInDVal);
80  }
81  void setStimOffsetDispersionInDefVal(double defVal) {
82  stimOffsetDispersionInDVal = defVal;
83  }
85  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_OUT";
86  return getDouble(key, stimOffsetDispersionOutDVal);
87  }
88  void setStimOffsetDispersionOutDefVal(double defVal) {
89  stimOffsetDispersionOutDVal = defVal;
90  }
91  double getStimDivisorIn() {
92  std::string key = getKeyPrefix() + "_STIM_DIVISOR_IN";
93  return getDouble(key, stimDivInDVal);
94  }
95 
96  void setStimDivisorInDefVal(double defVal) {
97  stimDivInDVal = defVal;
98  }
99 
100  double getStimDivisorOut() {
101  std::string key = getKeyPrefix() + "_STIM_DIVISOR_OUT";
102  return getDouble(key, stimDivOutDVal);
103  }
104 
105  void setStimDivisorOutDefVal(double defVal) {
106  stimDivOutDVal = defVal;
107  }
108 
110  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_IN";
111  return getDouble(key, stimDivDispersionInDVal);
112  }
113 
114  void setStimDivisorDispersionInDefVal(double defVal) {
115  stimDivDispersionInDVal = defVal;
116  }
118  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_OUT";
119  return getDouble(key, stimDivDispersionOutDVal);
120  }
121 
122  void setStimDivisorDispersionOutDefVal(double defVal) {
123  stimDivDispersionOutDVal = defVal;
124  }
125  double getStimCoxExpIn() {
126  std::string key = getKeyPrefix() + "_STIM_COX_EXP_IN";
127  return getDouble(key, stimCoxExpInDVal);
128  }
129  void setStimCoxExpInDefVal(double defVal) {
130  stimCoxExpInDVal = defVal;
131  }
132  double getStimCoxExpOut() {
133  std::string key = getKeyPrefix() + "_STIM_COX_EXP_OUT";
134  return getDouble(key, stimCoxExpOutDVal);
135  }
136  void setStimCoxExpOutDefVal(double defVal) {
137  stimCoxExpOutDVal = defVal;
138  }
139 
141  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_IN";
142  return getDouble(key, stimCoxExpDispersionInDVal);
143  }
144  void setStimCoxExpDispersionInDefVal(double defVal) {
145  stimCoxExpDispersionInDVal = defVal;
146  }
148  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_OUT";
149  return getDouble(key, stimCoxExpDispersionOutDVal);
150  }
151  void setStimCoxExpDispersionOutDefVal(double defVal) {
152  stimCoxExpDispersionOutDVal = defVal;
153  }
154  std::string getMessage();
159  virtual double computeDesirability(double vehInMeasure,
160  double vehOutMeasure);
161 
162  virtual double computeDesirability(double vehInMeasure, double vehOutMeasure, double vehInDispersionMeasure, double vehOutDispersionMeasure);
163 };
164 
165 #endif /* MSSOTLPOLICYSTIMULUS_H_ */
void setStimCoxExpInDefVal(double defVal)
void setStimDivisorDispersionInDefVal(double defVal)
void setStimCoxExpOutDefVal(double defVal)
void setStimOffsetDispersionOutDefVal(double defVal)
void setStimDivisorInDefVal(double defVal)
void setStimDivisorOutDefVal(double defVal)
void setStimOffsetInDefVal(double defVal)
void setStimCoxExpDispersionInDefVal(double defVal)
void setStimOffsetDispersionInDefVal(double defVal)
void setStimCoxExpDispersionOutDefVal(double defVal)
void setStimCoxDefVal(double defVal)
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
This class determines the desirability algorithm of a MSSOTLPolicy when used in combination with a hi...
void setStimOffsetOutDefVal(double defVal)
MSSOTLPolicy5DStimulus(std::string keyPrefix, const std::map< std::string, std::string > &parameters)
void setStimDivisorDispersionOutDefVal(double defVal)
virtual double computeDesirability(double vehInMeasure, double vehOutMeasure)
Computes stimulus function stimulus = cox * exp(-pow(pheroIn - offsetIn, 2)/divisor -pow(pheroOut - o...