update analyzeData
This commit is contained in:
parent
1978e5d636
commit
a22170efd0
@ -101,9 +101,14 @@ public class AccessPoint {
|
||||
}
|
||||
|
||||
private void analyseData() throws IOException {
|
||||
FileOutputStream file = new FileOutputStream("data.csv", true);
|
||||
// file.write("data1;data2".getBytes());
|
||||
file.close();
|
||||
try(FileOutputStream file = new FileOutputStream("data.csv", true)) {
|
||||
for(int i = 0; i < frame.length; i++) {
|
||||
for(int j = 0; j < frame[i].length; j++) {
|
||||
ResourceBlock ur = frame[i][j];
|
||||
file.write((i + ";" + j + ";" + this.users.indexOf(ur.getUser()) + ";" + ur.getBandwidth() + ";\n").getBytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void plotData() {
|
||||
|
@ -2,18 +2,26 @@ package fr.ntr;
|
||||
|
||||
public class ResourceBlock {
|
||||
private User user;
|
||||
private double bandwith;
|
||||
private double bandwidth;
|
||||
|
||||
public ResourceBlock (User user, double bandwith) {
|
||||
public ResourceBlock (User user, double bandwidth) {
|
||||
this.user = user;
|
||||
this.bandwith = bandwith;
|
||||
this.bandwidth = bandwidth;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public void setBandwith(double bandwith) {
|
||||
this.bandwith = bandwith;
|
||||
public void setBandwidth(double bandwidth) {
|
||||
this.bandwidth = bandwidth;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public double getBandwidth() {
|
||||
return bandwidth;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user