-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The traffic light remains red for longer than the time observed with get_red_time() #7625
Comments
Traffic lights operate in groups, and when one group's cycle ends, it waits at a red light until the other group's cycle finishes, resulting in a longer duration of the red light. For example, if there are two groups (Group 1 and Group 2) and each maintains green for 10 seconds, yellow for 3 seconds, and red for 2 seconds: When Group 1's cycle ends, Group 2's cycle begins, during which Group 1 stays on red. Thus, Group 1's red light lasts for 2 seconds (Group 1's red) + 10 seconds (Group 2's green) + 3 seconds (Group 2's yellow) + 2 seconds (Group 1's red) = 17 seconds. |
Currently in Town10, I am using
world.get_snapshot().timestamp.elapsed_seconds
to monitor whether the traffic lights stay for the designated duration.Upon investigation, I found that the yellow and green lights operate exactly for the set duration, but the red light remains unchanged and persists beyond the designated time (default 2 seconds).
Below is the code I used, and upon checking the saved CSV file, it appears that even though 2 seconds have elapsed, the traffic light remains set to red.
The text was updated successfully, but these errors were encountered: