diff --git a/plot/main.py b/plot/main.py index f858958..6e339f9 100644 --- a/plot/main.py +++ b/plot/main.py @@ -55,15 +55,18 @@ def delay() -> np.ndarray: for x in d: delays[nb, 0] = int(nb_users) delays[nb, 1] = float(x) + print(float(x)) nb += 1 return delays averages = mean_mkn() available = rb_available() +delays = delay() +delays.sort(axis=0) # Data for plotting averages.sort(axis=0) -print(averages) +#print(averages) fig, ax = plt.subplots() ax.scatter(averages[:, 0], averages[:, 1]) @@ -77,4 +80,11 @@ 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() + + +fig, ax = plt.subplots() +ax.scatter(delays[:, 0], delays[:, 1]) +ax.set(xlabel='number of users', ylabel='delays(ms)', title='Delay') +ax.grid() plt.show() \ No newline at end of file diff --git a/src/main/java/fr/ntr/AccessPoint.java b/src/main/java/fr/ntr/AccessPoint.java index 4eac135..dd75f79 100644 --- a/src/main/java/fr/ntr/AccessPoint.java +++ b/src/main/java/fr/ntr/AccessPoint.java @@ -58,7 +58,7 @@ public class AccessPoint { Files.deleteIfExists(Paths.get("export", this.users.size() + ".csv")); new File("export").mkdir(); this.outputDataFile = new FileOutputStream("export" + File.separator + this.users.size() + ".csv", true); - outputDataFile.write("tick;x;y;user;bandwidth;delay\n".getBytes()); + outputDataFile.write("tick;x;y;user;bandwidth;delay;\n".getBytes()); } catch(IOException e) { System.err.println(e.getClass().getSimpleName() + " : " + e.getMessage()); System.exit(1);