I'm sure that many plots could be beneficial. One of my favourites is to plot the waiting times against the arrival times. It can be quite diagnostic of what is happening.
For example, let's say my customers start reneging away from my service. I would expect to see the waiting times cap. Note that other effects could lead to capping, but it is a good start.
import ciw
import matplotlib.pyplot as plt
import pandas as pd
ciw.seed(2018)
N = ciw.create_network(
arrival_distributions=[ciw.dists.Exponential(5)],
service_distributions=[ciw.dists.Exponential(2)],
number_of_servers=[1],
reneging_time_distributions=[ciw.dists.Deterministic(5)]
)
Q = ciw.Simulation(N)
Q.simulate_until_max_time(30)
df = pd.DataFrame(
Q.get_all_records()
)
plt.scatter(df.arrival_date, df.waiting_time)
plt.xlabel('Arrival Time')
plt.ylabel('Waiting Time')
plt.show()
The same process without the reneging would just show the waiting times getting longer:
import ciw
import matplotlib.pyplot as plt
import pandas as pd
ciw.seed(2018)
N = ciw.create_network(
arrival_distributions=[ciw.dists.Exponential(5)],
service_distributions=[ciw.dists.Exponential(2)],
number_of_servers=[1],
)
Q = ciw.Simulation(N)
Q.simulate_until_max_time(30)
df = pd.DataFrame(
Q.get_all_records()
)
plt.scatter(df.arrival_date, df.waiting_time)
plt.xlabel('Arrival Time')
plt.ylabel('Waiting Time')
plt.show()
Or maybe I am only 'just' meeting demand on average, leading to some random walk behaviour:
import ciw
import matplotlib.pyplot as plt
import pandas as pd
ciw.seed(2018)
N = ciw.create_network(
arrival_distributions=[ciw.dists.Exponential(5)],
service_distributions=[ciw.dists.Exponential(5)],
number_of_servers=[1],
)
Q = ciw.Simulation(N)
Q.simulate_until_max_time(30)
df = pd.DataFrame(
Q.get_all_records()
)
plt.scatter(df.arrival_date, df.waiting_time)
plt.xlabel('Arrival Time')
plt.ylabel('Waiting Time')
plt.show()
Or maybe we've got substantially more supply than demand. Some customer don't even need to wait!
import ciw
import matplotlib.pyplot as plt
import pandas as pd
ciw.seed(2018)
N = ciw.create_network(
arrival_distributions=[ciw.dists.Exponential(5)],
service_distributions=[ciw.dists.Exponential(10)],
number_of_servers=[1],
)
Q = ciw.Simulation(N)
Q.simulate_until_max_time(30)
df = pd.DataFrame(
Q.get_all_records()
)
plt.scatter(df.arrival_date, df.waiting_time)
plt.xlabel('Arrival Time')
plt.ylabel('Waiting Time')
plt.show()
To be clear, I'm not saying these plots are the end-all-be-all. They're just helpful in diagnosing system behaviour (in conjunction with other tools).
at 5AM queue was 2 hours long
$\endgroup$