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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // The class the low-level policy stimulus
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 //#define SWARM_DEBUG
27 #include <sstream>
28 #include <cmath>
30 
39 
40 private:
41 
42  double stimCoxDVal,
46 
47 public:
48 
49  MSSOTLPolicy5DStimulus(std::string keyPrefix, const std::map<std::string, std::string>& parameters);
50 
51  double getStimCox() {
52  std::string key = getKeyPrefix() + "_STIM_COX";
53  return getDouble(key, stimCoxDVal);
54  }
55  void setStimCoxDefVal(double defVal) {
56  stimCoxDVal = defVal;
57  }
58  double getStimOffsetIn() {
59  std::string key = getKeyPrefix() + "_STIM_OFFSET_IN";
60  return getDouble(key, stimOffsetInDVal);
61  }
62  void setStimOffsetInDefVal(double defVal) {
63  stimOffsetInDVal = defVal;
64  }
65  double getStimOffsetOut() {
66  std::string key = getKeyPrefix() + "_STIM_OFFSET_OUT";
67  return getDouble(key, stimOffsetOutDVal);
68  }
69 
70  void setStimOffsetOutDefVal(double defVal) {
71  stimOffsetOutDVal = defVal;
72  }
73 
75  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_IN";
77  }
78  void setStimOffsetDispersionInDefVal(double defVal) {
80  }
82  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_OUT";
84  }
85  void setStimOffsetDispersionOutDefVal(double defVal) {
87  }
88  double getStimDivisorIn() {
89  std::string key = getKeyPrefix() + "_STIM_DIVISOR_IN";
90  return getDouble(key, stimDivInDVal);
91  }
92 
93  void setStimDivisorInDefVal(double defVal) {
94  stimDivInDVal = defVal;
95  }
96 
97  double getStimDivisorOut() {
98  std::string key = getKeyPrefix() + "_STIM_DIVISOR_OUT";
99  return getDouble(key, stimDivOutDVal);
100  }
101 
102  void setStimDivisorOutDefVal(double defVal) {
103  stimDivOutDVal = defVal;
104  }
105 
107  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_IN";
108  return getDouble(key, stimDivDispersionInDVal);
109  }
110 
111  void setStimDivisorDispersionInDefVal(double defVal) {
112  stimDivDispersionInDVal = defVal;
113  }
115  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_OUT";
116  return getDouble(key, stimDivDispersionOutDVal);
117  }
118 
119  void setStimDivisorDispersionOutDefVal(double defVal) {
120  stimDivDispersionOutDVal = defVal;
121  }
122  double getStimCoxExpIn() {
123  std::string key = getKeyPrefix() + "_STIM_COX_EXP_IN";
124  return getDouble(key, stimCoxExpInDVal);
125  }
126  void setStimCoxExpInDefVal(double defVal) {
127  stimCoxExpInDVal = defVal;
128  }
129  double getStimCoxExpOut() {
130  std::string key = getKeyPrefix() + "_STIM_COX_EXP_OUT";
131  return getDouble(key, stimCoxExpOutDVal);
132  }
133  void setStimCoxExpOutDefVal(double defVal) {
134  stimCoxExpOutDVal = defVal;
135  }
136 
138  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_IN";
140  }
141  void setStimCoxExpDispersionInDefVal(double defVal) {
143  }
145  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_OUT";
147  }
148  void setStimCoxExpDispersionOutDefVal(double defVal) {
150  }
151  std::string getMessage();
156  virtual double computeDesirability(double vehInMeasure,
157  double vehOutMeasure);
158 
159  virtual double computeDesirability(double vehInMeasure, double vehOutMeasure, double vehInDispersionMeasure, double vehOutDispersionMeasure);
160 };
161 
void setStimDivisorDispersionInDefVal(double defVal)
void setStimOffsetDispersionInDefVal(double defVal)
MSSOTLPolicy5DStimulus(std::string keyPrefix, const std::map< std::string, std::string > &parameters)
void setStimDivisorInDefVal(double defVal)
void setStimDivisorDispersionOutDefVal(double defVal)
void setStimCoxExpOutDefVal(double defVal)
void setStimCoxExpDispersionOutDefVal(double defVal)
virtual double computeDesirability(double vehInMeasure, double vehOutMeasure)
Computes stimulus function stimulus = cox * exp(-pow(pheroIn - offsetIn, 2)/divisor -pow(pheroOut - o...
void setStimCoxExpInDefVal(double defVal)
void setStimCoxExpDispersionInDefVal(double defVal)
void setStimOffsetInDefVal(double defVal)
void setStimCoxDefVal(double defVal)
void setStimOffsetDispersionOutDefVal(double defVal)
void setStimOffsetOutDefVal(double defVal)
void setStimDivisorOutDefVal(double defVal)
This class determines the desirability algorithm of a MSSOTLPolicy when used in combination with a hi...
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.