Increase number of users, add the current tick to data.csv
This commit is contained in:
parent
631ad01bfc
commit
6b9a526e49
@ -11,7 +11,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run {
|
run {
|
||||||
args = ["1000", "20"]
|
args = ["1000", "250"]
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
|
@ -71,7 +71,7 @@ public class AccessPoint {
|
|||||||
schedule();
|
schedule();
|
||||||
// traite les données et les enregistre dans un fichier
|
// traite les données et les enregistre dans un fichier
|
||||||
try {
|
try {
|
||||||
analyseData();
|
analyseData(ticks);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println("Can't export data");
|
System.out.println("Can't export data");
|
||||||
}
|
}
|
||||||
@ -95,35 +95,23 @@ public class AccessPoint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Génération du débit et des paquets
|
|
||||||
*/
|
|
||||||
private void init(int nbUsers) {
|
|
||||||
// 2 groupes d'utilisateurs, proches et éloignés
|
|
||||||
double[] distance = { 200d, 1000d };
|
|
||||||
for (int i = 0; i < distance.length; i++) {
|
|
||||||
for(int j = 0; j < nbUsers; j++){
|
|
||||||
User user = new User(distance[i], timeSlotNb, subCarrierNb);
|
|
||||||
this.users.add(user);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void schedule() {
|
private void schedule() {
|
||||||
scheduler.scheduling();
|
scheduler.scheduling();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void analyseData() throws IOException {
|
private void analyseData(int tick) throws IOException {
|
||||||
for(int i = 0; i < frame.length; i++) {
|
for(int i = 0; i < frame.length; i++) {
|
||||||
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];
|
||||||
String data = (i + ";" + j + ";" + this.users.indexOf(ur.getUser()) + ";" + ur.getBandwidth() + ";\n");
|
if(ur.getUser() != null) {
|
||||||
try{
|
String data = (tick + ";" + i + ";" + j + ";" + this.users.indexOf(ur.getUser()) + ";" + ur.getBandwidth() + ";\n");
|
||||||
outputDataFile.write(data.getBytes());
|
try{
|
||||||
}catch(IOException e){
|
outputDataFile.write(data.getBytes());
|
||||||
System.err.println("Cannot write the data in the output file");
|
}catch(IOException e){
|
||||||
System.exit(1);
|
System.err.println("Cannot write the data in the output file");
|
||||||
return;
|
System.exit(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public class User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* calcul délais de transmission des paquets
|
* Calcul délais de transmission des paquets
|
||||||
*/
|
*/
|
||||||
public void computeTimeSending() {
|
public void computeTimeSending() {
|
||||||
for(Packets p : packetsToSend){
|
for(Packets p : packetsToSend){
|
||||||
|
Reference in New Issue
Block a user