Activity: A Production System
Process View Modeling Activities
We build this model together: the instructor types the code, and you type along. Before each run, write down a prediction; then run and check it.
The situation. Parts arrive at a manufacturing system as a Poisson process, one every 5 minutes on average (stream 1). Every part is first prepared, by one of 2 preparation workers, in an exponential time with a mean of 8 minutes (stream 2). Then 30% of the parts are built on line 1 and 70% on line 2 (stream 3). Line 1 has 2 workers, and builds a part in a triangular time with minimum 2, mode 6, and maximum 8 minutes (stream 4); line 2 has 3 workers, with minimum 3, mode 6, and maximum 7 minutes (stream 5). Finally, one of 2 packaging workers wraps the part, in an exponential time with a mean of 2 minutes (stream 6), and then fills a box with packing peanuts, places the part in it, and seals it, in a time uniformly distributed between 1 and 2 minutes (stream 7). At every station, a part needs one worker, and waits in line for the next free worker.
Production runs for 30 days at a time, starting with no parts in the system. Simulate 100 replications of 30 days, in minutes, and complete this table, with averages and 95% half-widths to two decimal places:
| Performance measure | Average | Half-width |
|---|---|---|
| Time in the system for parts, either line | ||
| Probability that a part’s time in the system is less than 60 minutes | ||
| Utilization of the preparation workers | ||
| Utilization of the packaging workers | ||
| Utilization of the line 1 workers | ||
| Utilization of the line 2 workers | ||
| Number of parts produced in 30 days |
Setup. Get the starter file ProductionSystem.kt from the code/ folder beside this activity, and put it in src/main/kotlin/student/activities. Run its main. It compiles and runs, with no parts yet.
1. Model it first
Identify the entities, the resources with their capacities, and the activities.
Draw the activity diagram.
Write the part’s process as pseudo-code.
2. Predict
For a station with \(c\) workers, let \(\lambda\) represent the arrival rate of parts to the station and \(E[ST]\) the mean time a part needs a worker. Its utilization is \(\rho = \lambda E[ST]/c\). Predict the utilization of all four stations. (The mean of a triangular distribution is the average of its minimum, mode, and maximum.) Which station is the bottleneck?
About how many parts will the system produce in 30 days?
3. Code along
TODO 1 and TODO 2. We construct the four stations’ workers and the responses. Which response needs an
IndicatorResponse, and why?TODO 3. We create the parts with an
EntityGenerator, as in the previous activity, and write the part’s process. Packaging is two activities done by the same worker. Why do we seize the packaging worker once, delay twice, and release once, instead of callinguse()twice?
4. Results
Run the model and complete the table. How do the utilizations compare with your predictions?
Where is the bottleneck, and why? How much of a part’s time in the system is spent waiting there?
5. Extension: palletizing
After packaging, each box waits at a pallet machine until 10 boxes have accumulated. Then the machine wraps the pallet, which takes 2 minutes, and the pallet ships with its 10 boxes. A box is finished when its pallet ships.
Predict the number of pallets completed in 30 days.
Predict how long a box waits for its pallet, on average. (The first box of a pallet waits for 9 more; the last waits for none.) Then predict the time from a part’s arrival to its pallet’s shipping.
TODO 4. We change the
Partto aBatchingEntity<Part>and add aBatchQueueof size 10. After packaging, each box callswaitedForBatch(). Why must a box that waited end its process, and why does the box that forms the pallet record the time to shipping for every box in it?Run the model. How close were your predictions in 5a and 5b? Did the results of part 4 change?
The wait for a pallet hardly depends on the pallet machine, which is busy only 4% of the time. What does it depend on, and what would halve it?
When the 30 days end, some boxes are still waiting. At most how many, and are their times in the results?