Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question: (Supermarket Simulation) Write a program that simulates a check-out line at a supermarket. The line is a queue. Customers arrive in random integer intervals of 1 to 4 minutes. Also, each customer is serviced in random integer intervals of 1 to 4 minutes. Obviously, the rates need to be balanced. If the average arrival rate is larger than the average service rate, the queue will grow infinitely. Even with balanced rates, randomness can still cause long lines. Run the supermarket simulation for a 12-hour day (720 minutes) using the following algorithm:

1) Choose a random integer between 1 and 4 to determine the minute at which the first customer arrives.

2) At the first customer's arrival time: Determine customer's service time (random integer from 1 to 4); Begin servicing the customer; Schedule arrival time of next customer (random integer 1 to 4 added to the current time).

3) For each minute of the day: If the next customer arrives, Say so; Enqueue the customer; Schedule the arrival time of the next customer. If service was completed for the last customer, Say so; Dequeue next customer to be serviced; Determine customer's service completion time (random integer from 1 to 4 added to the current time). Now run your simulation for 720 minutes and answer each of the following:

a) What's the maximum number of customers in the queue at any time?

b) What's the longest wait any one customer experienced?

c) What happens if the arrival interval is changed from 1 to 4 minutes to 1 to 3 minutes?

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92489977
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Excel discussionconsider this using the mouse to point and

Excel discussion Consider this.... Using the mouse to point and click is one way to work on a computer. Often, the same work can be accomplished using just the keyboard, using shortcut keyboard combinations. For example, ...

Say you have some pictures each 500 kb in size say you also

Say you have some pictures each 500 KB in size. Say you also go to a store and buy a new desktop computer. Approximately how many pictures could you put on the hard disk, assuming you could use all the space on the disk ...

Questionimplement a calculator for a client-server

Question Implement a calculator for a client-server architecture using socket communication between the client and the server. The client should provide the graphical user interface for the user, and the server should pe ...

What are the key channels by which fiscal policy affects

What are the key channels by which fiscal policy affects output in a closed versus open economy? Using the models studied in class, discuss what is meant by "crowding out", and how the crowding out effect works in an ope ...

Answer the following questions whats the synchronous

Answer the following Questions : What's the synchronous distribution ? What are the guidelines for menu layout or list them?

1 why is it unlikely for magnesium to form a cation with a

1) Why is it unlikely for magnesium to form a cation with a charge of +1? 2) How can you tell whether disilicon hexabromide is considered an ionic or molecular compound according to its formula or name?

What is unified threat management utm and the services it

What is Unified Threat Management (UTM) and the services it combines into one device. Does UTM holds true to the principle of defense-in-depth

Question suppose we have a hash table which has the hash

Question : Suppose we have a hash table which has the hash function integer % 13. For Quadratic and Linear Probing, what sequence of 13 different integers > 0 (positive) would create a worst-case situation over the entir ...

Question you are shopping for a new computer you will be

Question: You are shopping for a new computer. You will be using the computer for everything you do, such as school, socializing, gaming, and communicating. Your total budget before tax is $1,000.00. Considerations: • Bu ...

It is said the best icons are more like traffic signs than

It is said "the best icons are more like traffic signs than graphic illustrations" providing a quick indication of the task they represent. Take a look at the Ribbon and tell us how well the graphic on each of the Ribbon ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As