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.dev/sumo
3 // Copyright (C) 2013-2024 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 
25 #include <sstream>
26 #include <cmath>
28 
37 
38 private:
39 
40  double stimCoxDVal,
44 
45 public:
46 
47  MSSOTLPolicy5DStimulus(std::string keyPrefix, const Parameterised::Map& parameters);
48 
49  double getStimCox() {
50  std::string key = getKeyPrefix() + "_STIM_COX";
51  return getDouble(key, stimCoxDVal);
52  }
53  void setStimCoxDefVal(double defVal) {
54  stimCoxDVal = defVal;
55  }
56  double getStimOffsetIn() {
57  std::string key = getKeyPrefix() + "_STIM_OFFSET_IN";
58  return getDouble(key, stimOffsetInDVal);
59  }
60  void setStimOffsetInDefVal(double defVal) {
61  stimOffsetInDVal = defVal;
62  }
63  double getStimOffsetOut() {
64  std::string key = getKeyPrefix() + "_STIM_OFFSET_OUT";
65  return getDouble(key, stimOffsetOutDVal);
66  }
67 
68  void setStimOffsetOutDefVal(double defVal) {
69  stimOffsetOutDVal = defVal;
70  }
71 
73  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_IN";
75  }
76  void setStimOffsetDispersionInDefVal(double defVal) {
78  }
80  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_OUT";
82  }
83  void setStimOffsetDispersionOutDefVal(double defVal) {
85  }
86  double getStimDivisorIn() {
87  std::string key = getKeyPrefix() + "_STIM_DIVISOR_IN";
88  return getDouble(key, stimDivInDVal);
89  }
90 
91  void setStimDivisorInDefVal(double defVal) {
92  stimDivInDVal = defVal;
93  }
94 
95  double getStimDivisorOut() {
96  std::string key = getKeyPrefix() + "_STIM_DIVISOR_OUT";
97  return getDouble(key, stimDivOutDVal);
98  }
99 
100  void setStimDivisorOutDefVal(double defVal) {
101  stimDivOutDVal = defVal;
102  }
103 
105  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_IN";
106  return getDouble(key, stimDivDispersionInDVal);
107  }
108 
109  void setStimDivisorDispersionInDefVal(double defVal) {
110  stimDivDispersionInDVal = defVal;
111  }
113  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_OUT";
114  return getDouble(key, stimDivDispersionOutDVal);
115  }
116 
117  void setStimDivisorDispersionOutDefVal(double defVal) {
118  stimDivDispersionOutDVal = defVal;
119  }
120  double getStimCoxExpIn() {
121  std::string key = getKeyPrefix() + "_STIM_COX_EXP_IN";
122  return getDouble(key, stimCoxExpInDVal);
123  }
124  void setStimCoxExpInDefVal(double defVal) {
125  stimCoxExpInDVal = defVal;
126  }
127  double getStimCoxExpOut() {
128  std::string key = getKeyPrefix() + "_STIM_COX_EXP_OUT";
129  return getDouble(key, stimCoxExpOutDVal);
130  }
131  void setStimCoxExpOutDefVal(double defVal) {
132  stimCoxExpOutDVal = defVal;
133  }
134 
136  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_IN";
138  }
139  void setStimCoxExpDispersionInDefVal(double defVal) {
141  }
143  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_OUT";
145  }
146  void setStimCoxExpDispersionOutDefVal(double defVal) {
148  }
149  std::string getMessage();
154  virtual double computeDesirability(double vehInMeasure,
155  double vehOutMeasure);
156 
157  virtual double computeDesirability(double vehInMeasure, double vehOutMeasure, double vehInDispersionMeasure, double vehOutDispersionMeasure);
158 };
void setStimDivisorDispersionInDefVal(double defVal)
void setStimOffsetDispersionInDefVal(double defVal)
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)
MSSOTLPolicy5DStimulus(std::string keyPrefix, const Parameterised::Map &parameters)
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...
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.