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-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 /****************************************************************************/
18 // The class the low-level policy stimulus
19 /****************************************************************************/
20 
21 #ifndef MSSOTLPOLICY5DSTIMULUS_H_
22 #define MSSOTLPOLICY5DSTIMULUS_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 
33 //#define SWARM_DEBUG
36 #include <sstream>
37 #include <cmath>
39 
48 
49 private:
50 
51  double stimCoxDVal,
55 
56 public:
57 
58  MSSOTLPolicy5DStimulus(std::string keyPrefix, const std::map<std::string, std::string>& parameters);
59 
60  double getStimCox() {
61  std::string key = getKeyPrefix() + "_STIM_COX";
62  return readParameter(key, stimCoxDVal);
63  }
64  void setStimCoxDefVal(double defVal) {
65  stimCoxDVal = defVal;
66  }
67  double getStimOffsetIn() {
68  std::string key = getKeyPrefix() + "_STIM_OFFSET_IN";
69  return readParameter(key, stimOffsetInDVal);
70  }
71  void setStimOffsetInDefVal(double defVal) {
72  stimOffsetInDVal = defVal;
73  }
74  double getStimOffsetOut() {
75  std::string key = getKeyPrefix() + "_STIM_OFFSET_OUT";
76  return readParameter(key, stimOffsetOutDVal);
77  }
78 
79  void setStimOffsetOutDefVal(double defVal) {
80  stimOffsetOutDVal = defVal;
81  }
82 
84  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_IN";
85  return readParameter(key, stimOffsetDispersionInDVal);
86  }
87  void setStimOffsetDispersionInDefVal(double defVal) {
88  stimOffsetDispersionInDVal = defVal;
89  }
91  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_OUT";
92  return readParameter(key, stimOffsetDispersionOutDVal);
93  }
94  void setStimOffsetDispersionOutDefVal(double defVal) {
95  stimOffsetDispersionOutDVal = defVal;
96  }
97  double getStimDivisorIn() {
98  std::string key = getKeyPrefix() + "_STIM_DIVISOR_IN";
99  return readParameter(key, stimDivInDVal);
100  }
101 
102  void setStimDivisorInDefVal(double defVal) {
103  stimDivInDVal = defVal;
104  }
105 
106  double getStimDivisorOut() {
107  std::string key = getKeyPrefix() + "_STIM_DIVISOR_OUT";
108  return readParameter(key, stimDivOutDVal);
109  }
110 
111  void setStimDivisorOutDefVal(double defVal) {
112  stimDivOutDVal = defVal;
113  }
114 
116  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_IN";
117  return readParameter(key, stimDivDispersionInDVal);
118  }
119 
120  void setStimDivisorDispersionInDefVal(double defVal) {
121  stimDivDispersionInDVal = defVal;
122  }
124  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_OUT";
125  return readParameter(key, stimDivDispersionOutDVal);
126  }
127 
128  void setStimDivisorDispersionOutDefVal(double defVal) {
129  stimDivDispersionOutDVal = defVal;
130  }
131  double getStimCoxExpIn() {
132  std::string key = getKeyPrefix() + "_STIM_COX_EXP_IN";
133  return readParameter(key, stimCoxExpInDVal);
134  }
135  void setStimCoxExpInDefVal(double defVal) {
136  stimCoxExpInDVal = defVal;
137  }
138  double getStimCoxExpOut() {
139  std::string key = getKeyPrefix() + "_STIM_COX_EXP_OUT";
140  return readParameter(key, stimCoxExpOutDVal);
141  }
142  void setStimCoxExpOutDefVal(double defVal) {
143  stimCoxExpOutDVal = defVal;
144  }
145 
147  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_IN";
148  return readParameter(key, stimCoxExpDispersionInDVal);
149  }
150  void setStimCoxExpDispersionInDefVal(double defVal) {
151  stimCoxExpDispersionInDVal = defVal;
152  }
154  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_OUT";
155  return readParameter(key, stimCoxExpDispersionOutDVal);
156  }
157  void setStimCoxExpDispersionOutDefVal(double defVal) {
158  stimCoxExpDispersionOutDVal = defVal;
159  }
160  std::string getMessage();
165  virtual double computeDesirability(double vehInMeasure,
166  double vehOutMeasure);
167 
168  virtual double computeDesirability(double vehInMeasure, double vehOutMeasure, double vehInDispersionMeasure, double vehOutDispersionMeasure);
169 };
170 
171 #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)
This class determines the desirability algorithm of a MSSOTLPolicy when used in combination with a hi...
void setStimOffsetOutDefVal(double defVal)
double readParameter(std::string parName, double defValue)
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...