TMPE icon indicating copy to clipboard operation
TMPE copied to clipboard

Timed-traffic light step switch condition wait = 0 always evaluating as True

Open simmichj opened this issue 2 years ago • 0 comments

Step switch conditions

The step switch condition of wait = 0 should prolong the current step if somebody is waiting for the light, or skip to the next step if nobody is waiting for the light.

From watching the other step switch condition that monitors waiting (wait > 0), it appears that the wait starts at 0 when the min time elapses and then increases to non-zero values if vehicles are slowing down for or stopped at the light. This is unlike the flow value which appears to start at a non-zero value if vehicles are moving when the min time elapses.

If the wait begins at 0 initially for the wait = 0 step, this means that this step switch condition will always evaluate as True before it has time to increase to a non-zero value and prolong the current step.

I'm using TM:PE 11.6.5.1 TEST. I have tested with simulation accuracy very high or very low.

Steps to reproduce

Create a simple timed traffic light at a crossing node with the following steps:

  1. Red for vehicle traffic, min 5s, max 20s, switch if wait > 0
  2. Red for vehicle traffic, min 5s, max 20s, switch if wait = 0
  3. Green for vehicle traffic, min 1s, max 60s, switch if flow = 0 (just to flush the queue through the intersection start again)

The very same waiting vehicles that will produce a non-zero wait value and cause the steps to switch from step 1 to step 2 will then fail to prevent the steps from switching prematurely from step 2 to step 3.

simmichj avatar Mar 28 '22 00:03 simmichj