# Exercises: Building Models

### From Sigma

The models referred to in these exercises are SIGMA models. Exercises identified as mini projects are more extensive and may take considerably longer than the typical exercise.

## Contents |

## Event Execution Priorities

Modify CARWASH.MOD so that arrivals occur exactly every 2 minutes and make the execution priorities on every edge the same. Run the model for 50 minutes then look at the output. What happens when an ENTER event and a LEAVE event take place simultaneously? What event should be executed first if there is an ENTER event and a START event scheduled at the same time and QUEUE=1?

## Pre-emptive Vertex Execution

Using pre-emptive vertex execution, modify the model, CARWASH.MOD, so that the logic of the simulation does not change but the number of events scheduled on the future events list is minimized. (Hint: Make some of the edge delay times equal to *; you will in effect incorporate the START vertex into both the ENTER and the LEAVE events).

Why might the output from a model that uses pre-emptive vertex execution be different from the output of the same model where pre-emptive execution is not used, i.e., all * delays are changed to 0? Why might the outputs be different even if the two models are logically equivalent in a probabilistic sense (output sample paths have the same probability of occurring)?

## Pre-emptive Vertex Execution with Parameter Passing

Using pre-emptive vertex execution (edge delay times set equal to *), modify the multiple server queue, BANK2.MOD, so that the logic of the simulation is not changed but a minimum number of events are scheduled on the future events list.

## System Reliability

Consider two systems, each with 50 identical components. System A is a serial system that fails when the first component fails. System B is a parallel system that fails when the last component fails. The times until failure, T, for the components are independent and have beta distributions with parameters 0.5 and 0.2. System B is obviously more reliable; however, it is desired to estimate the expected difference between the times until system failure for the two systems.

- Model both systems and then estimate the difference between the failure times of the two system.
- Would the variance of the sample difference generated in part (a) be biased? If so, in what direction?

## A Drive-in Bank Window (Mini Simulation Project)

A drive-in window is added to the side of the bank being modeled by BANK2.MOD. This window is serviced by the same tellers as before. The tellers rotate in serving customers at the drive-in window. Each teller will serve one drive-in customer and then return to service the line in the bank. If there are no customers at the drive-in window when a particular teller's turn comes up, s/he will miss a turn at the window.

Drive-in customers arrive according to the same pattern as the customers who arrive on foot (as described in the text) except that during the noon hour (12:00 to 1:00 P.M.) drive-in customers arrive at the rate of 2 per minute. Drive-in customers will balk if there are three or more cars waiting for service at the drive-in window. Of the balking drive-in customers, 80% will try to park their cars in the bank parking lot and walk inside for service. Once a former drive-in customer parks and walks inside, s/he will not balk unless the line has more than 20 customers in it.

The bank rents parking spaces in an adjacent parking lot for its customers. Currently the bank rents spaces for 10 cars. Customers desiring parking will wait only 30 seconds in a full lot before balking. Assume that it takes between 2 and 3 minutes (uniformly) for a customer to travel from the lot to the bank and vice versa (including time to park).

To better serve their customers, the bank is considering hiring additional tellers. Each teller costs the bank $1500.00 a month in salary and fringe benefits. As an alternative, the bank is considering renting additional parking spaces at $150.00 a month each.

Experiment with your simulation to advise the bank if they should hire tellers or rent parking spaces (or both). State your decision criteria and any additional assumptions that you need to make (e.g., tellers absent from work). Evaluate each of your assumption. (Are the assumptions conservative? Are they realistic? Can you confirm them with real-world data?)

## Variability and System Performance

The model FLOWSHOP.MOD is a simulation of a flow shop where there are several parallel machines at each of N sequential stations. A part needs to be processed by only one machine at each station. Run the system for three stations in a series where there are 5 machines at the first station, 3 machines at the second station, and 4 machines at the third station. The mean processing times (in hours) at each station have uniform distributions with means of 0.2 for each machine at the first station, 0.1 for the second station, and 1.5 at the third station. The processing time range is 0.05 for all machines. Run several 8 hour shifts and increase the processing time range to see the effect of variability on the performance of the system.

## A Queue with Service Breaks

Modify the model, BANK2.MOD, to more accurately simulate a ticket line at a major airport. At the ticket counter there are three agents. The time it takes an agent to serve a single passenger has an ERLANG (3) distribution with a mean of 15 minutes (5*ERL{3}). Every hour each agents takes a 5 minute break. They rotate breaks so one agent goes on break every 20 minutes. When an agent's break time is due, s/he will immediately stop whatever s/he is doing and go on break. If the agent is busy at the time, the passenger must wait until the agent returns from the break. An agent will finish the remaining service of a customer when s/he comes off break. Customers may not change agents once they start service even if the agent goes on break; the agent has their ticket. All passengers arrive at this departure desk in a taxi. The time between taxi arrivals has an exponential distribution with a mean of 1 minute. Passengers sometimes arrive in groups to share the taxi fare. Each taxi carries between 1 and 4 passengers. The likelihood of a group size of 1 is 0.6, the likelihood of a group size of 2 or 3 is 0.15, and the likelihood of 4 passengers arriving in a taxi is 0.1. Customers arrive in groups but each is processed alone. Run your model and watch the queue build up. Do you think the queue length will ever stabilize or do you expect it to continue to grow in an unbounded manner?

## Project Management

In the project management model, assume that the activity times have beta distributions with both parameters equal to 0.5 (see Functions) and scaled to be between the limits given in the following table.

Activity Must Follow Number of Time Range Activities Workers A None 1 1-3 B A 1 1-5 C None 1 2-4 D B and C 2 3-7 E B and D 1 2-4 F C 2 4-6

- Run the simulation of this project 100 times and estimate the probability that the project will take longer than 14 days.
- Assume that there are only 3 workers and a task needs the number of workers specified in the table above (tasks cannot be done partially, they must be completed once started). Modify the model to account for this resource constraint (PUT activities in a queue when their precedence constraints are met but not enough workers are available to start; GET tasks from this queue when activities finish.)