You will be creating and analysing a checkout (queue) model for ACME QuickMart, a general store
in a small, but growing regional town.
QuickMart's managers are very proud of their excellent quick service. The store currently only has
one queue and one checkout counter but, with a growing population, management is considering
new checkout options. They've done their market research of similar stores and want to compare
their one queue, one checkout station to the checkout models below:
•
one queue with three checkout stations, but the 2
one is only opened if 3 or more
nd
customers are waiting in the first line and the 3
one is only opened if 2 or more customers
rd
are waiting in the second line.
•
three queues with three checkout stations, where one is an express station for customers
with 8 or fewer items. The other two checkout stations are normal stations. If no customers
are in the express queue, the express checkout server will take the next customer in the
non-express queue with more waiting customers. If two queues have the same number of
customers, the express checkout server will take the next customer in the first queue.
QuickMart's management would like you to provide some analysis and recommendations on which
checkout configuration would provide the quickest checkout service for their customers
UNIVERSITY OF SOUTHERN QUEENSLAND CSC2410 – Computational Thinking with Python Assignment 2 Specification Due Date: 29 September 2022 Weight: 30% Submission What You Need to Submit – Three Files For a complete submission, you need to submit three files as specified below. The assignment submission system will accept only the files with extensions specified in this section. 1. Your answers for questions of part A in the provided “Assignment 2 part A template.docx” word file. 2. Completed part B and part C in the “Assignment2_PartBandC.ipynb”file. 3. The program of part B and part C in a file saved with a .doc/.docx/.odt extension must contain the exact same source code in the “Assignment2_PartBandC.ipynb”file. THIS IS NOT the “modsim.py” FILE. You can just download the .ipynb as a .py file, then copy the code in the .py file and paste it into the .doc/.docx/.odt file. If you don’t submit your code in both .doc/.docx/.odt and .ipynb files, or the code in .doc/.docx/.odt and .ipynb files is different, you will get a penalty (up to 45 marks). Academic misconduct Please ensure that you do not share any information about your assignment with anyone. Do not accidentally leave printouts or USB drives that contain your assignment details where someone else can access them. Make sure not to store your assignments on a computer where another student can access your assignment. Academic misconduct is unacceptable and includes plagiarism, collusion and cheating. You will find a further explanation at the link below: https://www.usq.edu.au/library/referencing/plagiarism. • This assignment must be all your own work • The source of all information must be correctly cited and referenced An assignment that does not adhere to these requirements has the potential to be deemed to be the result of academic misconduct. Please make sure to read the USQ policies. Should you have any queries regarding this assignment, please do not hesitate to email the course examiner. Assessment policy Please ensure to check the USQ assessment procedure http://policy.usq.edu.au/documents/14749PL. https://www.usq.edu.au/library/referencing/plagiarism http://policy.usq.edu.au/documents/14749PL Your Task Assignment 2 has three parts. Part A focuses on concepts introduced in the course readings. Part B and C focuses on the implementation of modelling and programming concepts covered in workshops. Please complete the part A in the “Assignment 2 part A template” word file. Please complete the part B and part C in the “Assignment2_PartBandC.ipynb”. Don’t need to submit “modsim.py” and “Australian_Population.csv” files. Part A (10/100 marks) Word count There is no specific word count. However, a complete answer would generally be around 200 or more words. Be concise but complete. Punctuation, Spelling & Grammar (2 marks) Essays will be marked for content as well as proper grammar, punctuation and spelling. A1: System Objects and State Objects (8 marks) Compare and contrast System Objects and State Objects. What does each represent? How are each used to simulate a model? Write a short essay answering these questions. Provide examples to illustrate your points. Part B (50/100 marks): Modelling & Simulation Case Study-Express Checkout Overview ACME QuickMart is a general store in a small, but growing, regional town. QuickMart's managements is very proud of their excellent quick service. The store currently only has one queue and one checkout counter but, with a growing population, management is considering new checkout options. QuickMart has done market research on checkout configurations in similar stores. Based on this market research, they would like you to provide analysis and recommendations on which checkout configuration below would provide the quickest checkout service for their customers. Checkout configurations • One queue, One checkout station - current configuration • One queue, Two checkout stations - where the 2nd is only opened if 3 or more customers are waiting in line. • Two queues, Two checkout stations - where one is an express station for customers with 10 or less items. In this model, if no customers are in the express queue, the express checkout server will take the next customer in the non-express queue. The queue.ipynb exercise from Week 9 will be VERY helpful! B1: One queue, one station [15 marks] We'll start by simulating ACME QuickMart's current checkout setup: one queue with one checkout station. • Assume that a customer is equally likely to arrive during any timestep. We'll denote this probability using the Greek letter lambda, ?, or the variable name lam. • Based on data provided, we know that, on average, it takes 5 minutes for a customer to check out. Though checkout times are highly variable. A simple way to model this variability is to assume that when a customer is checking out, they have the same probability of finishing up during each time step. We'll denote this probability using the Greek letter mu, ?, or the variable name mu. • Complete the One queue, One station functions below. • Generate and plot data for the One queue, One station scenario B1.1: Complete functions - one queue, one station def make_system(kwargs): Generalised version: The initial system state is passed to the function in the parameter kwargs: a dictionary which contains key word arguments. The kwargs provide the checkout system parameters. • Returns System object. kwargs provide the checkout system parameters. The parameters define the checkout system being simulated. ▪ kwargs: dictionary of key word arguments. For example, kwargs_1q1s = {'lam':1/6, 'mu':1/3, 'duration':600} can be an example argument of this function. • Solution of this function has been provided in the Jupyter Notebook template as an example. def update_func_1q1s(x, t, system): • Returns total number of customers at the end of the time step. If there's a customer checking out, use flip to decide if they are done. Also use flip to decide if a new customer has arrived. Takes parameters: ▪ x: total number of customers in the store, including the one checking out; ▪ t: number of minutes that have elapsed in the simulation, and ▪ system: a System object. def run_simulation(system, update_func): • Creates and returns a TimeSeries which stores the total number of customers in the store, including the one checking out, for each time step over the duration specified in the System object. Takes parameters: ▪ system: which is a System object. ▪ update_func: the update function to calculate number of customers in the store at the end of each time step. def param_sweep(low_range, high_range, param, num_vals): • Generates and returns an array which has a range of values for a parameter by sweeping through a range of possible values, from low to high. Takes parameters: ▪ low: low range of possible values ▪ high: high range of possible values ▪ param: parameter to sweep ▪ num_vals: number of values between low to high to generate def compute_metrics(results, system): • Use the function from the queue.ipynb notebook from Week 9's files. def sweep_lam(lam_array, system, update_func): • Runs simulations for a range of values for lam. For each value of lam, it runs a simulation, computes L and W, and stores the value of W in a SweepSeries. ▪ lam_array: array of values for lam. ▪ system: a System object. ▪ update_func: passed along to be used in run_simulation B1.2: Generate data & Plot scenario Using the functions created above, generate and plot data for the One queue, One station checkout scenario. Your graph should plot both the theorectial and simulated results. The plot title should provide the calculated W_avg for the One queue, One station scenario to two decimal places - i.e. One queue, One station: W_avg=n.nn 1. Create system object from kwargs: • Define variable kwargs with the following key word arguments ▪ Set lam (arrival rate per minute) as 1/8 ▪ Set mu (ave checkout time of 5 minutes) as 1/5 ▪ Set duration to 10 hours, expressed in mintues 2. Use the param_sweep function to generate an array of 101 lambda (?) values from 10% to 80% of the completion rate, ?. 3. Use the sweep_lam function to generate a SweepSeries of the average time in system. 4. Generate a plot with both theoretical and simulated data for the One queue, One station scenario. The plot title should include the calculated W_avg to two decimal places. B2: One queue, Two stations [10 marks] Now we'll explore our 2nd scenario: one queue with two checkout stations. But the 2nd station is only opened if 3 or more customers are waiting in the queue. • Complete the one queue, two stations update_func_1q2s function shown below. • Generate and plot data for the One queue, Two stations scenario. The plot title should provide the calculated W_avg for the One queue, Two stations scenario to two decimal places - i.e. One queue, Two station: W_avg=n.nn B2.1: Complete function - one queue, two stations B2.2: Generate data & Plot scenario Using the update_func_1q2s function created above, generate and plot data for the One queue, Two stations checkout scenario. Your graph should plot both the theorectial and simulated results. 1. Create system object: • Define variable kwargs with the following key word arguments ▪ Set lam (arrival rate per minute) as 1/8 ▪ Set mu (ave checkout time of 5 minutes) as 1/5 ▪ Set duration to 10 hours, expressed in mintues 2. Use the param_sweep function to generate an array of 101 lambda (?) values from 10% to 80% of the completion rate, ?. 3. Use the sweep_lam function to generate a SweepSeries of the average time in system. 4. Generate a plot with both theoretical and simulated data for the One queue, Two stations scenario. The plot title should include the calculated W_avg to two decimal places. B3: Express checkout: [20 marks] Now we'll explore our 3rd scenario: two queues with two checkout stations. Where the 2nd station is an express station for