Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An extended state machine describing a traffic light at a pedestrian crosswalk is shown above. This is a time triggered machine that assumes it will

image text in transcribed

An extended state machine describing a traffic light at a pedestrian crosswalk is shown above. This is a time triggered machine that assumes it will react once per second. It starts in the red state and counts 60 seconds with the help of the variable count. It then transitions to green, where it will remain until the pure input pedestrian is present. That input could be generated, for example, by a pedestrian pushing a button to request a walk light. When pedestrian is present, the machine transitions to yellow if it has been in state green for at least 60 seconds. Otherwise, it transitions to pending, where it stays for the remainder of the 60 second interval. This ensures that once the light goes green, it stays green for at least 60 seconds. At the end of 60 seconds, it will transition to yellow, where it will remain for 5 seconds before transitioning back to red. The outputs produced by this machine are sigG to turn on the green light, sigY to change the light to yellow, and sigR to change the light to red.

Please write a simulation in Python using the above formula to simulate the traffic light for 200 seconds with a scenario where a pedestrian is present at 70. second

Your simulation shall have a one second step size.

Your simulation shall log every second (in simulation time) time, inputs. system state and the outputs to console.

Figure 3.10: Extended state machine model of a traffic light controller that keeps track of the passage of time, assuming it reacts at regular intervals

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions