Week 3 Assignment

Identify a routinary activity that requires a queue to be managed, and document it. Highlight the attributes of the entities involved and the estimated times allotted for the execution of each step.

Create a Simio, or Python, or R model that resembles this activity. Identify bottlenecks in the process as it was initially documented, and suggest how it can be improved. Apply the suggested changes to the Simio model and compare the results of the original and modified process.

For this assignment, I selected a simple routine activity: waiting in line at a coffee shop. Let’s assume, customers arrive at the counter one by one. Each customer requires service from a cashier, which takes approximately 5 minutes. If the cashier is already busy, the customer must wait in a queue until the cashier is available. In our original process, there is only one cashier that helps all customers.

The bottleneck in this process is the cashier resource. Since we have only one cashier available, when many customers arrive at once, they must wait in line. This leads to increased waiting times for later arrivals.

Suggested changes: To improve and expedite this process, we want to add 2 more cashiers to the model. With three cashiers available, customers can be served at the same time, which significantly reduces waiting times.

# Create first environment
env <- simmer("coffee_shop")
# Define trajectory
customer <- trajectory("customer path") %>%
seize("cashier", 1) %>% # grab cashier
timeout(5) %>% # 5 min for customer
release("cashier", 1)

Original process with only 1 cashier

env %>%
add_resource("cashier", capacity = 1) %>%
add_generator("cust", customer, at(1:10)) # let's pretend 10 customers arriving at minutes 1–10
## simmer environment: coffee_shop | now: 0 | next: 0
## { Monitor: in memory }
## { Resource: cashier | monitored: TRUE | server status: 0(1) | queue status: 0(Inf) }
## { Source: cust | monitored: 1 | n_generated: 0 }
env %>% run(until = 60)
## simmer environment: coffee_shop | now: 51 | next: 
## { Monitor: in memory }
## { Resource: cashier | monitored: TRUE | server status: 0(1) | queue status: 0(Inf) }
## { Source: cust | monitored: 1 | n_generated: 10 }
get_mon_arrivals(env)
##     name start_time end_time activity_time finished replication
## 1  cust0          1        6             5     TRUE           1
## 2  cust1          2       11             5     TRUE           1
## 3  cust2          3       16             5     TRUE           1
## 4  cust3          4       21             5     TRUE           1
## 5  cust4          5       26             5     TRUE           1
## 6  cust5          6       31             5     TRUE           1
## 7  cust6          7       36             5     TRUE           1
## 8  cust7          8       41             5     TRUE           1
## 9  cust8          9       46             5     TRUE           1
## 10 cust9         10       51             5     TRUE           1

Improved process with 3 cashiers

env2 <- simmer("coffee_shop_improved")
env2 %>% add_resource("cashier", capacity = 3) %>% add_generator("cust", customer, at(1:10))
## simmer environment: coffee_shop_improved | now: 0 | next: 0
## { Monitor: in memory }
## { Resource: cashier | monitored: TRUE | server status: 0(3) | queue status: 0(Inf) }
## { Source: cust | monitored: 1 | n_generated: 0 }
env2 %>% run(until = 60)
## simmer environment: coffee_shop_improved | now: 21 | next: 
## { Monitor: in memory }
## { Resource: cashier | monitored: TRUE | server status: 0(3) | queue status: 0(Inf) }
## { Source: cust | monitored: 1 | n_generated: 10 }
get_mon_arrivals(env2)
##     name start_time end_time activity_time finished replication
## 1  cust0          1        6             5     TRUE           1
## 2  cust1          2        7             5     TRUE           1
## 3  cust2          3        8             5     TRUE           1
## 4  cust3          4       11             5     TRUE           1
## 5  cust4          5       12             5     TRUE           1
## 6  cust5          6       13             5     TRUE           1
## 7  cust6          7       16             5     TRUE           1
## 8  cust7          8       17             5     TRUE           1
## 9  cust8          9       18             5     TRUE           1
## 10 cust9         10       21             5     TRUE           1

Comparison: In original model with 1 cashier customers experienced waiting times, especially during busy arrival periods. - In improved model with 3 cashiers most customers began service immediately,and the queue almost disappeared. This demonstrates that increasing service capacity by two additional server can dramatically improve system efficiency and reduce waiting times.