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-2022 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
38private:
39
44
45public:
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 }
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 }
85 }
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
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";
107 }
108
111 }
113 std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_OUT";
115 }
116
119 }
121 std::string key = getKeyPrefix() + "_STIM_COX_EXP_IN";
122 return getDouble(key, stimCoxExpInDVal);
123 }
124 void setStimCoxExpInDefVal(double defVal) {
125 stimCoxExpInDVal = defVal;
126 }
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 }
141 }
143 std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_OUT";
145 }
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};
159
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.