You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improved optimization algorithm for traffic lights (#195)
* Update Dynamics.hpp with new algorithm
New algorithm from my thesis
* Update Node.hpp with modTime
modTime to keep track of how the algorithm changes the values of redTime and greenTime
* Merge Dynamics.hpp with main branch
* Merge Node.hpp with main branch
* Fix stalingrado example build
* Exclude more paths in examples
* Remove weird line
* Add m_dataUpdatePeriod var (previously hard-coded)
* Add densityTolerance parameter to optimizeTrafficLights()
* Add slow_charge_tl_vero.cpp
* Remove simulation file
* Fix Makefile
* Optimize new code
* Change percentage param name to nCycles in optimizeTrafficLights
* Division security
* Fix computations with unsigned values
* Revert Node.hpp to main version
* Add test for changing traffic light timings
* Add another test condition for traffic lights optimization
---------
Co-authored-by: vero-dav-vero <[email protected]>
/// @details Some data, i.e. the street queue lengths, are stored only after a fixed amount of time which is represented by this variable.
155
+
voidsetDataUpdatePeriod(Delay dataUpdatePeriod) {
156
+
m_dataUpdatePeriod = dataUpdatePeriod;
157
+
}
150
158
151
159
/// @brief Update the paths of the itineraries based on the actual travel times
152
160
virtualvoidupdatePaths();
@@ -161,11 +169,14 @@ namespace dsm {
161
169
/// @param reinsert_agents If true, the agents are reinserted in the simulation after they reach their destination
162
170
virtualvoidevolve(bool reinsert_agents = false);
163
171
/// @brief Optimize the traffic lights by changing the green and red times
164
-
/// @param percentage double, The percentage of the TOTAL cycle time to add or subtract to the green time
172
+
/// @param nCycles Delay, The number of cycles (times agents are being added) between two calls of this function
165
173
/// @param threshold double, The percentage of the mean capacity of the streets used as threshold for the delta between the two tails.
174
+
/// @param densityTolerance double, The algorithm will consider all streets with density up to densityTolerance*meanDensity
166
175
/// @details The function cycles over the traffic lights and, if the difference between the two tails is greater than
167
176
/// the threshold multiplied by the mean capacity of the streets, it changes the green and red times of the traffic light, keeping the total cycle time constant.
// If the difference is not less than the threshold
792
+
// - Check that the incoming streets have a density less than the mean one (eventually + tolerance): I want to avoid being into the cluster, better to be out or on the border
0 commit comments