1. Imagine a very long bridge across the Mississippi River. A car will take upwards of 15 minutes to cross this bridge. Due to construction, the bridge has been reduced to a single lane that has to be shared by traffic in both directions. It is obviously not possible to allow traffic in both directions simultaneously, and so a special traffic control mechanism is installed with the following rules: • An arriving car will have to wait if the bridge is currently occupied by one or more cars moving in the opposite direction. • Multiple cars are allowed to cross the bridge in the same direction at the same time (one after another) • In order to avoid starvation, the entry of cars onto the bridge in one direction must be stopped after a batch of K cars has entered the bridge from one direction, to allow traffic moving in the opposite direction (if there are any cars waiting) • If there are no cars, the bridge is open in both directions, and the first arriving car will determine the direction of traffic. Viewing each car as a process that is traveling in either the West-East (WE) or East-West (EW) direction, develop a MONITOR that implements the rules listed above. Your MONITOR must use the monitor procedures Enter_WE(), Enter_EW(), Exit_WE(), Exit_EW() when a car enters and exits the bridge. Your solution must show all necessary MONITOR variables and condition variables. It must not unnecessarily restrict vehicles attempting to cross the bridge, must be deadlock free, and must not starve traffic in either direction.

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter11: Nonlinear Programming
Section11.10: Quadratic Programming
Problem 7P
icon
Related questions
Question

what's the pseudo code for this question? 

1. Imagine a very long bridge across the Mississippi River. A car will take upwards of 15 minutes to cross this bridge. Due to construction, the bridge
has been reduced to a single lane that has to be shared by traffic in both directions. It is obviously not possible to allow traffic in both directions
simultaneously, and so a special traffic control mechanism is installed with the following rules:
• An arriving car will have to wait if the bridge is currently occupied by one or more cars moving in the opposite direction.
Multiple cars are allowed to cross the bridge in the same direction at the same time (one after another)
●
• In order to avoid starvation, the entry of cars onto the bridge in one direction must be stopped after a batch of K cars has entered the bridge from
one direction, to allow traffic moving in the opposite direction (if there are any cars waiting)
• If there are no cars, the bridge is open in both directions, and the first arriving car will determine the direction of traffic.
Viewing each car as a process that is traveling in either the West-East (WE) or East-West (EW) direction, develop a MONITOR that implements the
rules listed above. Your MONITOR must use the monitor procedures Enter_WE(), Enter_EW(), Exit_WE(), Exit_EW() when a car enters and exits the
bridge.
Your solution must show all necessary MONITOR variables and condition variables. It must not unnecessarily restrict vehicles attempting to cross the
bridge, must be deadlock free, and must not starve traffic in either direction.
Transcribed Image Text:1. Imagine a very long bridge across the Mississippi River. A car will take upwards of 15 minutes to cross this bridge. Due to construction, the bridge has been reduced to a single lane that has to be shared by traffic in both directions. It is obviously not possible to allow traffic in both directions simultaneously, and so a special traffic control mechanism is installed with the following rules: • An arriving car will have to wait if the bridge is currently occupied by one or more cars moving in the opposite direction. Multiple cars are allowed to cross the bridge in the same direction at the same time (one after another) ● • In order to avoid starvation, the entry of cars onto the bridge in one direction must be stopped after a batch of K cars has entered the bridge from one direction, to allow traffic moving in the opposite direction (if there are any cars waiting) • If there are no cars, the bridge is open in both directions, and the first arriving car will determine the direction of traffic. Viewing each car as a process that is traveling in either the West-East (WE) or East-West (EW) direction, develop a MONITOR that implements the rules listed above. Your MONITOR must use the monitor procedures Enter_WE(), Enter_EW(), Exit_WE(), Exit_EW() when a car enters and exits the bridge. Your solution must show all necessary MONITOR variables and condition variables. It must not unnecessarily restrict vehicles attempting to cross the bridge, must be deadlock free, and must not starve traffic in either direction.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Probability Problems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole