SUMO - Simulation of Urban MObility
MSSOTLPolicy5DStimulus.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // The class the low-level policy stimulus
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2013-2017 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 
22 #ifndef MSSOTLPOLICY5DSTIMULUS_H_
23 #define MSSOTLPOLICY5DSTIMULUS_H_
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 //#define SWARM_DEBUG
37 #include <sstream>
38 #include <math.h>
40 
49 
50 private:
51 
52  double stimCoxDVal,
56 
57 public:
58 
59  MSSOTLPolicy5DStimulus(std::string keyPrefix, const std::map<std::string, std::string>& parameters);
60 
61  double getStimCox() {
62  std::string key = getKeyPrefix() + "_STIM_COX";
63  return readParameter(key, stimCoxDVal);
64  }
65  void setStimCoxDefVal(double defVal) {
66  stimCoxDVal = defVal;
67  }
68  double getStimOffsetIn() {
69  std::string key = getKeyPrefix() + "_STIM_OFFSET_IN";
70  return readParameter(key, stimOffsetInDVal);
71  }
72  void setStimOffsetInDefVal(double defVal) {
73  stimOffsetInDVal = defVal;
74  }
75  double getStimOffsetOut() {
76  std::string key = getKeyPrefix() + "_STIM_OFFSET_OUT";
77  return readParameter(key, stimOffsetOutDVal);
78  }
79 
80  void setStimOffsetOutDefVal(double defVal) {
81  stimOffsetOutDVal = defVal;
82  }
83 
85  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_IN";
86  return readParameter(key, stimOffsetDispersionInDVal);
87  }
88  void setStimOffsetDispersionInDefVal(double defVal) {
89  stimOffsetDispersionInDVal = defVal;
90  }
92  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_OUT";
93  return readParameter(key, stimOffsetDispersionOutDVal);
94  }
95  void setStimOffsetDispersionOutDefVal(double defVal) {
96  stimOffsetDispersionOutDVal = defVal;
97  }
98  double getStimDivisorIn() {
99  std::string key = getKeyPrefix() + "_STIM_DIVISOR_IN";
100  return readParameter(key, stimDivInDVal);
101  }
102 
103  void setStimDivisorInDefVal(double defVal) {
104  stimDivInDVal = defVal;
105  }
106 
107  double getStimDivisorOut() {
108  std::string key = getKeyPrefix() + "_STIM_DIVISOR_OUT";
109  return readParameter(key, stimDivOutDVal);
110  }
111 
112  void setStimDivisorOutDefVal(double defVal) {
113  stimDivOutDVal = defVal;
114  }
115 
117  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_IN";
118  return readParameter(key, stimDivDispersionInDVal);
119  }
120 
121  void setStimDivisorDispersionInDefVal(double defVal) {
122  stimDivDispersionInDVal = defVal;
123  }
125  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_OUT";
126  return readParameter(key, stimDivDispersionOutDVal);
127  }
128 
129  void setStimDivisorDispersionOutDefVal(double defVal) {
130  stimDivDispersionOutDVal = defVal;
131  }
132  double getStimCoxExpIn() {
133  std::string key = getKeyPrefix() + "_STIM_COX_EXP_IN";
134  return readParameter(key, stimCoxExpInDVal);
135  }
136  void setStimCoxExpInDefVal(double defVal) {
137  stimCoxExpInDVal = defVal;
138  }
139  double getStimCoxExpOut() {
140  std::string key = getKeyPrefix() + "_STIM_COX_EXP_OUT";
141  return readParameter(key, stimCoxExpOutDVal);
142  }
143  void setStimCoxExpOutDefVal(double defVal) {
144  stimCoxExpOutDVal = defVal;
145  }
146 
148  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_IN";
149  return readParameter(key, stimCoxExpDispersionInDVal);
150  }
151  void setStimCoxExpDispersionInDefVal(double defVal) {
152  stimCoxExpDispersionInDVal = defVal;
153  }
155  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_OUT";
156  return readParameter(key, stimCoxExpDispersionOutDVal);
157  }
158  void setStimCoxExpDispersionOutDefVal(double defVal) {
159  stimCoxExpDispersionOutDVal = defVal;
160  }
161  std::string getMessage();
166  virtual double computeDesirability(double vehInMeasure,
167  double vehOutMeasure);
168 
169  virtual double computeDesirability(double vehInMeasure, double vehOutMeasure, double vehInDispersionMeasure, double vehOutDispersionMeasure);
170 };
171 
172 #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...