4eme courbe
This commit is contained in:
parent
83e4ccdd22
commit
5b695174a6
24
plot/main.py
24
plot/main.py
@ -45,6 +45,20 @@ def delay(arr: list[tuple[int, np.ndarray]]) -> np.ndarray:
|
|||||||
nb += 1
|
nb += 1
|
||||||
return delays
|
return delays
|
||||||
|
|
||||||
|
def rb_available_distance(arr: list[tuple[int, np.ndarray]], distance) -> np.ndarray:
|
||||||
|
available = np.zeros((size, 2))
|
||||||
|
nb = 0
|
||||||
|
for nb_users, data in arr:
|
||||||
|
n = 0
|
||||||
|
for x in data[:,6]:
|
||||||
|
if int(x) == distance:
|
||||||
|
n+=1
|
||||||
|
|
||||||
|
available[nb, 0] = nb_users
|
||||||
|
available[nb, 1] = n/ (200 * 10000) * 100
|
||||||
|
nb += 1
|
||||||
|
return available
|
||||||
|
|
||||||
|
|
||||||
np_arr: list[tuple[int, np.ndarray]] = list()
|
np_arr: list[tuple[int, np.ndarray]] = list()
|
||||||
for i in nb_files:
|
for i in nb_files:
|
||||||
@ -52,6 +66,10 @@ for i in nb_files:
|
|||||||
|
|
||||||
averages = mean_mkn(np_arr)
|
averages = mean_mkn(np_arr)
|
||||||
available = rb_available(np_arr)
|
available = rb_available(np_arr)
|
||||||
|
|
||||||
|
available_lp1 = rb_available_distance(np_arr, 200)
|
||||||
|
available_lp2 = rb_available_distance(np_arr, 400)
|
||||||
|
|
||||||
delays = delay(np_arr)
|
delays = delay(np_arr)
|
||||||
delays.sort(axis=0)
|
delays.sort(axis=0)
|
||||||
# Data for plotting
|
# Data for plotting
|
||||||
@ -70,4 +88,10 @@ ax[1, 0].scatter(delays[:, 0], delays[:, 1])
|
|||||||
ax[1, 0].set(xlabel='number of users', ylabel='delays(ms)', title='Delay')
|
ax[1, 0].set(xlabel='number of users', ylabel='delays(ms)', title='Delay')
|
||||||
ax[1, 0].grid()
|
ax[1, 0].grid()
|
||||||
|
|
||||||
|
#ax[1, 1].scatter(available[:, 0], (available_lp1[:, 1]/available_lp2[:, 1])/available[:, 1] * 100)
|
||||||
|
ax[1, 1].scatter(available[:, 0], available_lp1[:, 1])
|
||||||
|
ax[1, 1].scatter(available[:, 0], available_lp2[:, 1])
|
||||||
|
ax[1, 1].set(xlabel='number of users', ylabel='RB utilisés proche/loin/total', title='RB utilisés distance')
|
||||||
|
ax[1, 1].grid()
|
||||||
|
|
||||||
plt.show()
|
plt.show()
|
Reference in New Issue
Block a user