delays
This commit is contained in:
parent
7295530501
commit
fa14796c17
12
plot/main.py
12
plot/main.py
@ -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])
|
||||||
|
|
||||||
@ -78,3 +81,10 @@ 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()
|
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()
|
@ -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);
|
||||||
|
Reference in New Issue
Block a user