This commit is contained in:
Tr1xt4n 2023-03-28 09:35:26 +02:00
parent 7295530501
commit fa14796c17
2 changed files with 12 additions and 2 deletions

View File

@ -55,15 +55,18 @@ def delay() -> np.ndarray:
for x in d: for x in d:
delays[nb, 0] = int(nb_users) delays[nb, 0] = int(nb_users)
delays[nb, 1] = float(x) delays[nb, 1] = float(x)
print(float(x))
nb += 1 nb += 1
return delays return delays
averages = mean_mkn() averages = mean_mkn()
available = rb_available() available = rb_available()
delays = delay()
delays.sort(axis=0)
# Data for plotting # Data for plotting
averages.sort(axis=0) averages.sort(axis=0)
print(averages) #print(averages)
fig, ax = plt.subplots() fig, ax = plt.subplots()
ax.scatter(averages[:, 0], averages[:, 1]) ax.scatter(averages[:, 0], averages[:, 1])
@ -77,4 +80,11 @@ fig, ax = plt.subplots()
ax.scatter(available[:, 0], available[:, 1]) ax.scatter(available[:, 0], available[:, 1])
ax.set(xlabel='number of users', ylabel='RB utilisés', title='Pourcentage de RB utilisés') ax.set(xlabel='number of users', ylabel='RB utilisés', title='Pourcentage de RB utilisés')
ax.grid() 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() plt.show()

View File

@ -58,7 +58,7 @@ public class AccessPoint {
Files.deleteIfExists(Paths.get("export", this.users.size() + ".csv")); Files.deleteIfExists(Paths.get("export", this.users.size() + ".csv"));
new File("export").mkdir(); new File("export").mkdir();
this.outputDataFile = new FileOutputStream("export" + File.separator + this.users.size() + ".csv", true); 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) { } catch(IOException e) {
System.err.println(e.getClass().getSimpleName() + " : " + e.getMessage()); System.err.println(e.getClass().getSimpleName() + " : " + e.getMessage());
System.exit(1); System.exit(1);