Add percentage of RB usage
This commit is contained in:
parent
8a556e999a
commit
9f2178ed49
33
plot/main.py
33
plot/main.py
@ -26,18 +26,43 @@ def mean_mkn() -> np.ndarray:
|
||||
return averages_mkn
|
||||
|
||||
|
||||
def rb_available() -> np.ndarray:
|
||||
available = np.zeros((size, 2))
|
||||
nb = 0
|
||||
for i in nb_files:
|
||||
data = pd.read_csv(".." + os.sep + "export" + os.sep + i, delimiter=';').to_numpy()
|
||||
nb_users = i.split(".")[0]
|
||||
available[nb, 0] = int(nb_users)
|
||||
available[nb, 1] = data.shape[0] / (200 * 10000)
|
||||
nb += 1
|
||||
|
||||
"""for j in range(0, 2):
|
||||
for k in range(0, 10000):
|
||||
nb_users = i.split(".")[0]
|
||||
available[nb, 0] = int(nb_users)
|
||||
if j == data[nb, 1] and k == data[:, 2]:
|
||||
available[nb, 1] += 1
|
||||
"""
|
||||
return available
|
||||
|
||||
|
||||
averages = mean_mkn()
|
||||
available = rb_available()
|
||||
# Data for plotting
|
||||
averages.sort(axis=0)
|
||||
x = averages[:, 0]
|
||||
y = averages[:, 1]
|
||||
|
||||
print(averages)
|
||||
fig, ax = plt.subplots()
|
||||
ax.scatter(x, y)
|
||||
ax.scatter(averages[:, 0], averages[:, 1])
|
||||
|
||||
ax.set(xlabel='users', ylabel='ressources (RB)', title='MaxSNR')
|
||||
ax.set(xlabel='number of users', ylabel='Efficacité spectrale', title='Efficacité spectrale')
|
||||
ax.grid()
|
||||
|
||||
# fig.savefig("test.png")
|
||||
plt.show()
|
||||
|
||||
fig, ax = plt.subplots()
|
||||
ax.scatter(available[:, 0], available[:, 1])
|
||||
ax.set(xlabel='number of users', ylabel='RB utilisés', title='Pourcentage de RB utilisés')
|
||||
ax.grid()
|
||||
plt.show()
|
||||
|
Reference in New Issue
Block a user