-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathq2_2.py
More file actions
32 lines (30 loc) · 724 Bytes
/
Copy pathq2_2.py
File metadata and controls
32 lines (30 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from MMSK.mathAnalysis import *
from MMSK.simulation import *
import matplotlib.pyplot as plt
import math
mu = 6
s = 2
k = 8
x = []
Wqy = []
simWqy = []
for i in range(2, 8):
x.append(i)
quSim = queueSim(i, mu, s, k, 10000)
quSim.simRun()
simWqy.append(quSim.avgWaitQuTime)
Wqy.append(Wq(i, mu, s, k)*60)
print('MATH:x = ', x, ', y = ', Wqy)
print('SIM :x = ', x, ', y = ', simWqy)
plt.plot(x, simWqy, 'ro-', label='sim')
plt.plot(x, Wqy, 'g^-', label='math')
plt.title('Wq')
plt.xlabel('lambda')
plt.ylabel('Wq(min)')
tempX = x
for x, y in zip(x, Wqy):
plt.text(x, y, '%.2f' % y, ha='center', va='bottom')
for x, y in zip(tempX, simWqy):
plt.text(x, y, '%.2f' % y, ha='center', va='bottom')
plt.legend()
plt.show()