# Exercises: Event Graph Modeling

### From Sigma

The models referred to in these exercises are SIGMA models.

## Batch Arrivals to a Queue

Assume that cars arrive at a drive-up fast food restaurant with equal probability of having 1, 2, 3, or 4 customers in the car. Assume that service takes between 25 and 35 seconds per customer and cars arrive every 1 to 3 minutes (both service and interarrival distributions are uniform). Modify this carwash event graph to model this system.

## Parameter Passing

In the following event graph, plot the values of X at times 0 to 6.5?

## Future Events List

In a simulated queue with one line and five parallel servers (like Bank1.MOD):

- What is the minimum number of events on the events list while the simulation is running?
- What type of event(s) does this minimum list contain?
- What is the maximum number of events on the list during a run?
- What type of event(s) does this maximum length list contain?

## Limited Waiting Space

Assume that the waiting line in BANK1.MOD has space for only 5 customers; there are three tellers. The maximum number of customers in the system is eight: three in service and five in line. Customers who arrive to find a full system are turned away. Change BANK1.MOD to reflect this constraint and re-run the first 30 customer service completions. Print your graph, output, and model. Record the number of arrivals that were turned away because the queue was full when they arrived. Again calculate the average waiting time for the first 10, 20, and 30 customers. Compute averages by hand or use a special statistics gathering vertex).

## A Two Server Queue

Consider a queueing system with a single line and two identical parallel servers. The resident entity model, BANK1.MOD, and the transient entity model, BANK2.MOD, on your SIGMA disk are simulations of such a system.

Modify BANK2.MOD to have a finite capacity in this system of a total of at most 10 customers (a maximum of two customers in service and eight waiting in line). Arrivals that occur when the system is full are turned away. Customer arrivals occur according to a Poisson process with a constant rate of 1.5 customers per minute. (This is the same as exponentially distributed interarrival times with a mean of 1/1.5 = 0.667, given by .667*ERL{1}.) Each server has an exponentially distributed service time with mean of 1 minute. The arrival and service processes are all mutually independent. The objective for studying this system is to estimate the distributions for the customer waiting times and distributions for the server utilizations.

- Give the entities in this system (tell which are resident and which are transient). Give the attributes of each entity. Also list the sets of entities with their owners and members.
- List the events for this system. Give the state transformations for each event. Also give the conditions and delay times for scheduling each of the events. Show the relationships between events with an event graph.
- What event(s) should be scheduled initially to begin running this simulation for 100 simulated hours?
- What event(s) should be initially scheduled to run this simulation for 100 simulated customer service completions?
- What would happen if a customer tries to ENTER a full queue at the exact same time that another customer LEAVEs the server? Which of these two simultaneous events should be executed first?

## Sensitivity Analysis

Customers arrive at an ice cream parlor at a rate uniformly distributed between 2 and 6 minutes and are served at a rate uniformly distributed between 3 and 8 minutes. Model this queue. After 4 hours, what is the average length of the queue? If another scooper is hired, what is the average length of the queue? How many scoopers must be hired to keep the average length of the queue below 2 customers?

## Fast Food

Customers waiting for fast food are very impatient. If they see 4 or more people waiting in line already, they will not enter. At peak hours, customers arrive at a rate uniformly distributed between 0.5 and 3 minutes. With current processes, each customer can be served in 2 minutes. Can the processes be speeded up enough to make sure the store never loses customers? (no). Can we speed up service so that we have a very low probability of losing customers? (yes). What is the necessary processing time for a specified probability for losing a customer that you think is reasonable? Build a model that can be used to answer this question.

## Parameter Passing

Give the number and types of events that will be on the list of scheduled events at time 21.5 in the following event graph.

## A Bank

- Suppose that cars arrive at a bank's drive-through facility at a rate uniformly distributed between 2 and 10 minutes and each transaction requires 3 minutes. Model this queue.
- Now suppose that the bank added two more identical tellers and customers arrive at each one at a uniform rate between 5 and 15 minutes. Model this situation by modifying your answer for (a).

## The Post Office

- Suppose customers arrive at a post office at a rate uniformly distributed between 2 and 3 minutes. A postal official can serve each customer at a rate uniformly distributed between 1 and 10 minutes. Model the service at the post office.
- Modify this model for a post office with 3 postal officials. Upon entry, all customers line up in one queue. The first person in the queue is served by the next available official.
- Modify this model again for a post office where one lazy clerk takes a 5 minute break (will not serve) after he serves 3 customers.

## An Assembly Station

A factory mass produces widgets. Each widget has 3 component parts: A, B, and C. Each of these 3 types of parts is produced in its own area of the factory and then transported via assembly line to the assembly area. Parts A, B, and C arrive at the assembly area every 4, 5, and 10 minutes, respectively. A worker takes a time uniformly distributed between 5 and 10 minutes to assembly the widget. Model this production process.

## Communications Network Repair

A local area network has 100 identical links between work stations. Links fail at random intervals. The time until a working link fails has an exponential distribution with a mean of 5 days. Once a link fails, it must wait for a repairman to fix it. The time to repair a link has a uniform distribution between 1 and 2 hours. A single repairman is on duty at all times. Build a simulation of this maintenance system. Use your model to develop a trade-off curve between performance of the system (how should this be measured?) and the number of repairmen on duty. (Hint: Use the model, CARWASH.MOD, as a starting place where links (instead of cars) queue up for the single repairman (instead of a carwash machine). Also note that the rate that links fail depends on the number of working links at a given time. (This failure process is called a state-dependent Poisson process.)

## A Water Reservoir System

Three water reservoirs (at A, B, and C) serve a city through the pipeline system shown below.

Three identical (type 1) pumps at stations a, b, and c pump water from each reservoir to pumping station d. A large (type 2) pump at d pumps water to another type 2 pump at booster station e, which pumps water to the city. The time until failure of a type i pump (i = 1 or 2) is uniformly distributed between 12i and 4(i+1) months. Pump failures are independent, and pumps are not repaired until the water flow to the city actually stops. Model this system to predict when the city will run out of water due to pump failures.

## Preventive Maintenance Policy Optimization

A conveyor system has 40 identical rollers, each with a failure distribution uniformly distributed between 20 and 45 days. When a roller fails, it must be repaired at a cost of $500. When preventive maintenance is performed on the conveyor, the cost is $300+$50*N, where N is the number of rollers replaced. A partial group replacement policy of performing preventive maintenance every M months and replacing all rollers over A months old is being considered. Model this system to try to suggest reasonable values for M and A.

## Elimination of the Future Events List.

Create an event graph that is logically equivalent to the carwash model but does not schedule any events on the future events list. (Hint: Use a generic minimum function, min(a,b), to determine the next event time.)

- What is the main advantage of your modified model? (Consider speed)
- What is the main disadvantage of your model?

## Queues with Blocking

There are three identical and independent servers for each of two tandem queues. There is room for only 3 customers in queue 2; when queue 2 is full, no one can exit from any of the first set of three servers until a service completion for the second set of servers occurs.

- Identify the resident and transient entities along with their attributes. Present your entity-attribute hierarchy in outline form. Give the set of possible values for each attribute.
- Identify sets of entities and tell which entities (if any) "own" each set and what entities may be members of each set.
- Describe the discrete events in the cycles of activities for each resident entity. Also describe the events in the path of each temporary entity as they flow through the system. For each event tell what state changes occur and the conditions for these changes along with what further events will be scheduled or cancelled in a computer routine for the event.

## Simultaneous Events

In a queueing simulation, BRKDN.MOD, if an idle server is scheduled to start a break (STARTBREAK event) at the same time a customer arrival occurs (ARRIVAL event), which event should be executed first? No other events are on the events list and all other events have the same execution priority.

## Nested Loops

- Create a nested loop with three index variables: I going from 1 to 4, J going from 1 to I, and K going from 0 to I*J.
- Create an event graph which finds the sum of all the elements of a 3 by 5 array.
- Give the event graph for a nested loop where the inner loop moves twice as fast as the outer loop.
- Draw an event graph for a program that produces the entries in a table that translates from 1 to 20 degrees Celsius to Fahrenheit.