Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this problem you must use Python semaphore class. Your implementation for this problem must only use the semaphore methods to control the concurrency of

For this problem you must use Python semaphore class. Your implementation for this problem must only use the semaphore methods to control the concurrency of your solution (IE. acquire and release).

ASSIGNMENT DESCRIPTION
Consider a small take-out food restaurant called Burrito Brothers that is open 24 hours, seven days a week. This very popular establishment offers a VERY-TASTY burrito. There are three servers that own a private beef area, a cheese area, and a tortilla area (IE. Each server has their own ingredients in an infinite supply). Additionally, there are three shared counter locations, a shared cash register and a shared waiting area that can accommodate up to 15 customers. By law the shop has a maximum customer capacity of 15. A customer cannot enter the shop if it is filled to capacity. If the there is room a customer will gain access to the shop. Each customer will enter the shop with an order of one to 20 burritos. As soon as a server is free, the customer that has the shortest order is served next.

A server is either servicing a customer or waiting. Each server will make (at most) three burritos at time for a given customer. Once a server has obtained all ingredients, a burrito can be made. When a customer’s entire order is finished, the customer pays a cashier and leaves the shop. Since there is only one cash register, only one patron may pay at a time. However, in the event that a customer’s entire order has not been filled by the server at the completion of the current counter visit the customer must reenter the waiting area. The waiting area is organized by the shortest order next.

THE FINISHED ASSIGNMMENT MUST INCLUDE THE FOLLOWING:
Implement a solution to this problem as a Python application using the Python semaphore class for synchronization. Your zip file must expand into a single directory and your application must compile at the command prompt using python. Output must include the arrival of each customer and each state transition: leaving full shop, entering shop with an order of m burritos, customer standing, getting service from server n, paying, and leaving. Each customer is represented by a corresponding thread and each server in your implementation is also represented by a unique Python thread. All customers and servers exist within a single application.

Step by Step Solution

3.33 Rating (159 Votes )

There are 3 Steps involved in it

Step: 1

solution Burritojava import javautilScanner public class Burrito protected static int NoOfCustomers0 protected static int NoOfServers0 protected static int StorCapacity0 protected static int ArrivalWi... 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

Survey of Accounting

Authors: Carl S Warren

6th edition

978-113318912, 1133189121, 978-1133189121

More Books

Students also viewed these Accounting questions