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 2001-2013 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 
56 
57 public:
58 
59  MSSOTLPolicy5DStimulus(std::string keyPrefix, const std::map<std::string, std::string>& parameters);
60 
62  std::string key = getKeyPrefix() + "_STIM_COX";
63  return readParameter(key, stimCoxDVal);
64  }
65  void setStimCoxDefVal(SUMOReal defVal) {
66  stimCoxDVal = defVal;
67  }
69  std::string key = getKeyPrefix() + "_STIM_OFFSET_IN";
70  return readParameter(key, stimOffsetInDVal);
71  }
73  stimOffsetInDVal = defVal;
74  }
76  std::string key = getKeyPrefix() + "_STIM_OFFSET_OUT";
77  return readParameter(key, stimOffsetOutDVal);
78  }
79 
81  stimOffsetOutDVal = defVal;
82  }
83 
85  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_IN";
86  return readParameter(key, stimOffsetDispersionInDVal);
87  }
89  stimOffsetDispersionInDVal = defVal;
90  }
92  std::string key = getKeyPrefix() + "_STIM_OFFSET_DISPERSION_OUT";
93  return readParameter(key, stimOffsetDispersionOutDVal);
94  }
96  stimOffsetDispersionOutDVal = defVal;
97  }
99  std::string key = getKeyPrefix() + "_STIM_DIVISOR_IN";
100  return readParameter(key, stimDivInDVal);
101  }
102 
104  stimDivInDVal = defVal;
105  }
106 
108  std::string key = getKeyPrefix() + "_STIM_DIVISOR_OUT";
109  return readParameter(key, stimDivOutDVal);
110  }
111 
113  stimDivOutDVal = defVal;
114  }
115 
117  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_IN";
118  return readParameter(key, stimDivDispersionInDVal);
119  }
120 
122  stimDivDispersionInDVal = defVal;
123  }
125  std::string key = getKeyPrefix() + "_STIM_DIVISOR_DISPERSION_OUT";
126  return readParameter(key, stimDivDispersionOutDVal);
127  }
128 
130  stimDivDispersionOutDVal = defVal;
131  }
133  std::string key = getKeyPrefix() + "_STIM_COX_EXP_IN";
134  return readParameter(key, stimCoxExpInDVal);
135  }
137  stimCoxExpInDVal = defVal;
138  }
140  std::string key = getKeyPrefix() + "_STIM_COX_EXP_OUT";
141  return readParameter(key, stimCoxExpOutDVal);
142  }
144  stimCoxExpOutDVal = defVal;
145  }
146 
148  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_IN";
149  return readParameter(key, stimCoxExpDispersionInDVal);
150  }
152  stimCoxExpDispersionInDVal = defVal;
153  }
155  std::string key = getKeyPrefix() + "_STIM_COX_EXP_DISPERSION_OUT";
156  return readParameter(key, stimCoxExpDispersionOutDVal);
157  }
159  stimCoxExpDispersionOutDVal = defVal;
160  }
161  std::string getMessage();
166  virtual SUMOReal computeDesirability(SUMOReal vehInMeasure,
167  SUMOReal vehOutMeasure);
168 
169  virtual SUMOReal computeDesirability(SUMOReal vehInMeasure, SUMOReal vehOutMeasure, SUMOReal vehInDispersionMeasure, SUMOReal vehOutDispersionMeasure);
170 };
171 
172 #endif /* MSSOTLPOLICYSTIMULUS_H_ */
void setStimDivisorOutDefVal(SUMOReal defVal)
void setStimOffsetDispersionInDefVal(SUMOReal defVal)
void setStimCoxExpDispersionOutDefVal(SUMOReal defVal)
void setStimCoxDefVal(SUMOReal defVal)
void setStimCoxExpOutDefVal(SUMOReal defVal)
void setStimCoxExpDispersionInDefVal(SUMOReal defVal)
SUMOReal readParameter(std::string parName, SUMOReal defValue)
void setStimOffsetOutDefVal(SUMOReal defVal)
void setStimDivisorDispersionInDefVal(SUMOReal defVal)
This class determines the desirability algorithm of a MSSOTLPolicy when used in combination with a hi...
void setStimDivisorInDefVal(SUMOReal defVal)
virtual SUMOReal computeDesirability(SUMOReal vehInMeasure, SUMOReal vehOutMeasure)
Computes stimulus function stimulus = cox * exp(-pow(pheroIn - offsetIn, 2)/divisor -pow(pheroOut - o...
void setStimCoxExpInDefVal(SUMOReal defVal)
#define SUMOReal
Definition: config.h:213
void setStimOffsetInDefVal(SUMOReal defVal)
void setStimOffsetDispersionOutDefVal(SUMOReal defVal)
MSSOTLPolicy5DStimulus(std::string keyPrefix, const std::map< std::string, std::string > &parameters)
void setStimDivisorDispersionOutDefVal(SUMOReal defVal)