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

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

## 20 statements 4 run 16 missing 0 excluded

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

1 import openqtsim

2 import pandas as pd

3 import numpy as np

4

5

6 def get_waiting_time_service_time_table(utilisations, servers, nr_arr):

7 """

8 Generate a waiting time over service time ratio table

9 """

10

11 lams = utilisations * 10

12 mu = 10

13

14 df = pd.DataFrame(index=utilisations, columns=servers)

15

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

22

23 # Create the queue object and use it to create a simulating object

24 q = openqtsim.Queue(A, S, c)

25 # q.kendall_notation

26

27 sim = openqtsim.Simulation(q)

28 sim.run(nr_arr)

29

30 df2 = sim.return_log()

31

32 factor = np.mean(df2["TCWQ"]) / np.mean(df2["ST"])

33 df.iloc[index, server - 1] = factor

34

35 print(sim.queue.kendall_notation)

36

37 return df, sim