From 5b695174a66cf7a9e82c23831550114b022ded11 Mon Sep 17 00:00:00 2001 From: Tr1xt4n Date: Tue, 4 Apr 2023 09:56:16 +0200 Subject: [PATCH] 4eme courbe --- plot/main.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/plot/main.py b/plot/main.py index 8d7118f..c70c541 100644 --- a/plot/main.py +++ b/plot/main.py @@ -45,6 +45,20 @@ def delay(arr: list[tuple[int, np.ndarray]]) -> np.ndarray: nb += 1 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() for i in nb_files: @@ -52,6 +66,10 @@ for i in nb_files: averages = mean_mkn(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.sort(axis=0) # 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].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() \ No newline at end of file