use anylogic to make simulation for the 3 questions in file
HOMEWORK IE 406: Simulation Fall 2016 Dr. Xueping Li —————————————————————————————————————————— Homework Assignment (#3) Goal:: To assess the following: making plots; collecting TIS, WIP, AWTQ, ATIS; embedded statistics (Queue); using variables; using calendar; basic animation; etc. 1: Simulate the check-in process at a clinic. The clinic operates from 8am to 5pm, Monday through Friday. The patient arrival rate is estimated at one patient every two minutes. The check-in process takes about five to ten minutes while historical data shows that on average it takes seven minutes. Currently there are three check-in staffs who call the patients at the waiting room when they are available. Simulate the process with animation of the waiting process and the idle/busy of the staffs. Make plots of the WIP (work-in-process) over time, the number of people waiting in the waiting room over time, the average waiting time over time, and the average time in system (TIS) so far over time. Make histograms for TIS and waiting time in queue. Simulate one day of the system and report 1) the average waiting time in queue; 2) average time in system; 3) time average of number of patients waiting in the queue and 4) number of patients checked in. Remember to use random seed number 1. Open question: how many check-in staffs are needed if we want the patient waiting time is less than 8 min- utes? (You may relax the random seed number here, meaning it (AWTQ ≤ 8min) holds true for almost all the instances/runs.) How about less than 2 minutes? 2: Five identical machines operate independently in a small shop. Each machine is up (i.e., works) for between 7 and 10 hours (uniformly distributed) and then breaks down. There are two repair technicians available, and it takes one technician between 1 and 4 hours (uniformly distributed) to fix a machine; only one technician can be assigned to work on a broken machine even if the other technician is idle. If more than two machines are broken down at a given time, they form a (virtual) FIFO “repair” queue and wait for the first available technician. A technician works on a broken machine until it is fixed, regardless of what else is happening in the system. All uptimes and downtimes are independent of each other. Starting with all machines at the beginning of an “up” time, simulate this for 160 hours and observe the time-average number of machines that are down (in repair or in queue for repair), as well as the utilization of the repair technicians as a group; put your results in a text box in your model. Animate the machines when they are either undergoing repair or in queue for a repair technician, and plot the total number of machines down (in repair plus in queue) over time. (HINT: Think of the machines as “customers” and the repair technicians as “servers” and note that there are always five machines floating around in the model as they never leave.) 3: In science museums, you’ll often find what’s called a probability board (also known as a quincunx). This is like a big, shallow, tilted baking pan with a slot at the midpoint of the top edge through which marbles roll, one at a time, from a reservoir outside the board; Just below the slot is a fixed peg, which each incoming marble hits and causes the marble to roll left or right off; assume that you have tilted the board so that there’s an equal chance that the marble will roll left vs. right (interpret “left” and “right” from your viewpoint as you look at the board from in front of it, which is the opposite from the marbles’ viewpoint as they dive down the board nose first on their 1 stomachs). Below this peg is a row of two pegs, parallel to the top edge of the board but offset horizontally from the first peg so that the two pegs in this second row are diagonally arranged below the first peg, as in the picture. Figure 1: A quincunx illustration. let’s say the reservoir has k marbles in it. Assume that the board’s tilt angle, the peg spacing, the marbles’ mass, and the gravitational field of the host planet are just right so that each marble will next hit ex- actly one of the two pegs in the second row (which peg it hits is determined by whether it rolled left or right off of the first peg). The marble will next roll left or right off of whichever peg it hits in the second row (again, assume a 50-50 chance of rolling left vs. right). The next parallel row of pegs has three pegs in it, again offset so that each marble will hit exactly one of them and roll left or right, again with equal probabilities. This continues through the last row; let’s say that the number of rows is n so that the last row has n pegs in it (n = 6 in the picture, counting the first peg at the top as its own row). After rolling off of a peg in the last row, the marble will land in exactly one of n + 1 bins arranged diagonally under the last row of pegs. Create a simulation model to simulate a probability board with n = 6 rows of pegs and k = 1500 marbles in the reservoir. Animate the marbles bouncing down the board, and also animate the number of marbles accumulating in the bins at the bottom. In addition, count the number of marbles that land in each of the 7 bins. The proportion of marbles landing in each bin estimates the probabilities of what distribution? What if somebody opens a window to the left of the board and a wind comes in to blow the marbles toward the right as they roll, so that there’s a 75% (rather than 50%) chance that they’ll roll to the right off of each peg? Submission Guideline: Submit your files to Canvas & email your homework to
[email protected]. For emailing, when you have multiple files, please zip them into one single file. 7zip (http://www.7-zip.org/) is recommended and .7z file extension is suggested. Note that occasionally, UTK email system may filter emails with attachments, especially when attachments are like .zip and/or with executable files. You should receive an email notification if your email goes through. 2
[email protected] http://www.7-zip.org/