Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Finite state machines are around us everywhere. State machines put simply, are logical unitsthat are limited to being in only one state at any given
Finite state machines are around us everywhere. State machines put simply, are logical unitsthat are limited to being in only one state at any given time. A finite state machine is one thatis limited to a defined set of states there are defined limits to the number of possible states itcan be inTraffic lights are a good example of finite state machines. In a typical traffic light, there are possible states: Green go Amber dont begin to cross the intersection because the red light isabout to trigger and Red stop Each state is strictly timed can be different in duration foreach state and synchronized with the opposing set of lights.Workshop DetailsA busy intersection in downtown Toronto needs to upgrade the current light state trafficlight system see illustration below to a light state system to address an increasingly heavydemand for left turns. A computer simulation needs to be developed as a proof of concept.Page APS Applied Problem SolvingLooking at the light that is red, we see the cars are stopped, waiting for the light to turn green.If of more cars line up the car sensor will signal the light to turn green sooner, as describedbelow. The pedestrian who wants to go in the same direction as the cars stopped on the redlight is also stopped. If the pedestrian presses the walk button on the light pole, this will alsodecrease the wait time for the red light as described below.The lights in the new system are as follows: Red Amber Green Advance left turnGreen to AmberLight State Traffic Light: Sequence of statesThe sequence of a light state system is shown in the above illustration. Below are the states including the time duration for each state: Solid Green Advanced Left Green Arrow seconds Solid Green Advanced Left Amber Arrow seconds Solid Green Advanced Left Arrow of seconds Solid Amber seconds Solid Red seconds YOU FIGURE THIS OUT Additional FeaturesPage APS Applied Problem SolvingRequestToWalk ButtonA button is provided for pedestrians to press to alert the system a person needs to cross. This isonly effective when the lights are in a redlight state. This request will reduce the remainingwait time of the redlight state to seconds.Car SensorThere is a sensor mounted on the light fixtures that monitors the number of waiting cars whenin a redlight state. When the number of cars waiting reaches or more, the sensor will triggerthe system to reduce the remaining wait time of the redlight state to seconds.InterruptThe defined system should take in to account an interrupt. This is something that can occur atany time and will take oversupersede the active state. Examples of this type of interruptioncan be the traffic controllers setting all lights to flash amber for caution or to flash red waystop etc... You dont need to specify what the interrupt should do only account for it bychecking if there is an interrupt to the normal process flow and how the system shouldresume when the interrupt has completed.Work BreakdownLogic Define a standard light system red green, amber with an interrupt no advancegreen, request to walk, or car sensor The light durations are: Green sec Amber secand Redyou figure this out Flow chart
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started