+distance

This commit is contained in:
Tr1xt4n 2023-04-04 08:19:36 +02:00
parent be44a1d098
commit 83e4ccdd22

View File

@ -38,7 +38,7 @@ public class AccessPoint {
public void startSimulation(int duration) { public void startSimulation(int duration) {
try{ try{
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;distance;\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);
@ -96,7 +96,7 @@ public class AccessPoint {
for(int j = 0; j < frame[i].length; j++) { for(int j = 0; j < frame[i].length; j++) {
ResourceBlock ur = frame[i][j]; ResourceBlock ur = frame[i][j];
if(ur.getUser() != null) { if(ur.getUser() != null) {
String data = (tick + ";" + i + ";" + j + ";" + this.users.indexOf(ur.getUser()) + ";" + ur.getBandwidth() + ";" + delayAverage +";\n"); String data = (tick + ";" + i + ";" + j + ";" + this.users.indexOf(ur.getUser()) + ";" + ur.getBandwidth() + ";" + delayAverage +";" + ur.getUser().getDistance() + ";" + "\n");
try{ try{
outputDataFile.write(data.getBytes()); outputDataFile.write(data.getBytes());
}catch(IOException e){ }catch(IOException e){