Develop a checkout lane simulation

Assignment Help Computer Engineering
Reference no: EM132058

Develop a simple checkout system. That system was so successful that they've decided to expand their operations by opening additional checkout lanes. Unfortunately, they are unsure of just how many lanes they need to add. Ideally, Cougar Mart would add enough lanes to satisfy expected demand. However, opening too many lanes would mean that they're paying checkers to staff empty lanes. Your goal is to develop a checkout lane simulation that can be used to determine the optimal number of lanes that Cougar Mart should have open.

Your program should simulate an entire day at Cougar Mart, in minutes. For this simulation, we will assume that Cougar Mart is open 12 hours a day. As this is a simulation, you don't actually need to run your program for 12 hours. Instead, consider the time span to be an integer, with each minute being a number. As such, 0 would indicate the start of the simulation, 1 would represent the first minute of the simulation, 2 the second minute, and so on.

Program Flow

Your simulation should operate as follows:

1. Prompt the user for the number of checkstands to simulate

2. Create a vector that contains the appropriate number of checkstands

3. Set the probability of a new customer arriving equal to 0.

4. For each minute in the simulation

a. Determine if a new customer has arrived.
i. Generate a random number between 0 and 5.
ii. If the random number is less than or equal to the probability of a new customer arriving (Step #3), go to Step 4.B.
iii. If the number is greater than the probability of a new customer arriving (Step #3), increment the probability of the new customer arriving by 1. Go to Step 4.C.

b. If a new customer has arrived, create a new customer whose arrival time is equal to the current simulation time and whose service time is a randomly generated number between 1 and 4. Next, try to find an empty checkstand. If one exists, place the customer in the line at that checkstand. If no empty checkstand exists, randomly select a checkstand for the customer to enter.

c. For each checkstand in the simulation:
i. If there is at least one customer in the checkstand, go to 4.C.II. Otherwise, go back to 4.C.
ii. If the first customer in line has not received a departure time, calculate one. Departure time = arrival time + service time.
iii. If the total time elapsed is greater than the first customer's departure time, then the customer has completed the checkout process. Remove them from the queue.
d. Increment the elapsed time in the simulation

5. After the simulation completes, write the results to a CSV file in the following format:

<Customer ID>, <Arrival Time>, <Time to Check Out>, <Departure Time>, <Total Wait>, <Line Number>.

Also include the total number of customers generated during the simulation at the top of the CSV file. Note that an example CSV file will be included with this assignment description. I have provided a CsvWriter class to aid in the construction of CSV files.

Reference no: EM132058

Questions Cloud

Standard deviation for this suv model : What is the city mileage standard deviation for this SUV model?
Marketing strategy for this relatively new product : Create a PowerPoint presentation about the marketing strategy for this relatively new product
Male offspring with the allele combinations : Explain why there are no male offspring with the allele combinations
Problem on transmission line operation : Evaluate the TL parameters. Include the effect of the earth as ideal. Do not incorporate the effect of the shield wires.
Develop a checkout lane simulation : Develop a checkout lane simulation that can be used to determine the optimal number of lanes that Cougar Mart should have open.
Describe the effects of monetary policies : Describe the effects of monetary policies on the economy's production and employment.
Issues that telecommuting raises for hrm : Explain your impression of the culture of an organization or group to which you have belonged or for which you have worked.
Prepare a trouble ticket to record the problem : Prepare a Trouble Ticket to record the problem
Explain cross site scripting attack : Explain Cross Site Scripting attack

Reviews

Write a Review

Computer Engineering Questions & Answers

  Intermediate programming

Design a program that reads in a text file with drawing commands and then outputs a bitmap with all the items drawn correctly

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Write a research report on design of a cisco router

Systems research and investigate novel ideas and applications.

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Hardware support to memory management

Study any two multicore processor architecture and discuss the following features briefly

  Find minimal cover and identify all possible candidate keys

Find minimal cover and identify all possible candidate keys - Functional Dependencies

  A non-linear circuit problem

Computer program which will calculate the voltage across a resistor in the circuit

  Design a dedicated datapath

Design a dedicated datapath

  Application to computer science

Find the matrices that represent the relations.

  Prepare a use case diagram

Prepare a Use Case Diagram based on the given problem description.

  Risk assessment of ict system

Risk Assessment of ICT System and Developing Computer Incident Response System on WAMP platform

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd