Open kianzarrin opened 2 years ago
this diff will do it. Just need UI to make it optional.
diff --git a/TLM/TLM/TrafficLight/Impl/TimedTrafficLightsStep.cs b/TLM/TLM/TrafficLight/Impl/TimedTrafficLightsStep.cs
index 2b5be2a7..dd1970d7 100644
--- a/TLM/TLM/TrafficLight/Impl/TimedTrafficLightsStep.cs
+++ b/TLM/TLM/TrafficLight/Impl/TimedTrafficLightsStep.cs
@@ -931,6 +931,8 @@ namespace TrafficManager.TrafficLight.Impl {
bool addToFlow = false;
+ bool ignore = false;
+ const bool ignoreRight = true; // TODO: make optional
switch (dir) {
case ArrowDirection.Turn: {
@@ -946,7 +948,11 @@ namespace TrafficManager.TrafficLight.Impl {
}
case ArrowDirection.Right: {
- addToFlow = segLight.IsRightGreen();
+ if (ignoreRight) {
+ ignore = true;
+ } else {
+ addToFlow = segLight.IsRightGreen();
+ }
break;
}
@@ -965,7 +971,7 @@ namespace TrafficManager.TrafficLight.Impl {
() => "TimedTrafficLightsStep.calcWaitFlow: ## Vehicles @ " +
$"lane {laneIndex}, seg. {sourceSegmentId} going to seg. " +
$"{targetSegmentId}: COUTING as FLOWING -- numMovingVehicles={numMovingVehicles}");
- } else {
+ } else if(!ignore) {
curTotalLaneWait += numVehicles;
++numLaneWaits;
Therefore I think we need an option to skip right turn in flow/wait calculations.