Coverage for C:\checkouts\github\OpenQTSim\openqtsim\tables.py : 20%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import openqtsim
2import pandas as pd
3import numpy as np
6def get_waiting_time_service_time_table(utilisations, servers, nr_arr):
7 """
8 Generate a waiting time over service time ratio table
9 """
11 lams = utilisations * 10
12 mu = 10
14 df = pd.DataFrame(index=utilisations, columns=servers)
16 for index, lam in enumerate(lams):
17 for server in servers:
18 # Create Arrival and Service processes and specify the number of servers
19 A = openqtsim.ArrivalProcess("M", arr_rate=lam)
20 S = openqtsim.ServiceProcess("M", srv_rate=mu)
21 c = server
23 # Create the queue object and use it to create a simulating object
24 q = openqtsim.Queue(A, S, c)
25 # q.kendall_notation
27 sim = openqtsim.Simulation(q)
28 sim.run(nr_arr)
30 df2 = sim.return_log()
32 factor = np.mean(df2["TCWQ"]) / np.mean(df2["ST"])
33 df.iloc[index, server - 1] = factor
35 print(sim.queue.kendall_notation)
37 return df, sim