From 275a764752e0adc1ddd71398a49c0ea9bb6b7e19 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Fri, 17 Mar 2023 11:18:48 +0100 Subject: [PATCH] Add timeslot and subcarreir size --- src/main/java/fr/ntr/AccessPoint.java | 4 +++- src/main/java/fr/ntr/Main.java | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/ntr/AccessPoint.java b/src/main/java/fr/ntr/AccessPoint.java index b72c2c1..8d836d1 100644 --- a/src/main/java/fr/ntr/AccessPoint.java +++ b/src/main/java/fr/ntr/AccessPoint.java @@ -90,7 +90,9 @@ public class AccessPoint { 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()); + String data = (i + ";" + j + ";" + this.users.indexOf(ur.getUser()) + ";" + ur.getBandwidth() + ";\n"); + System.out.println("data: " + data); + file.write(data.getBytes()); } } } diff --git a/src/main/java/fr/ntr/Main.java b/src/main/java/fr/ntr/Main.java index 21922b1..3c7457e 100644 --- a/src/main/java/fr/ntr/Main.java +++ b/src/main/java/fr/ntr/Main.java @@ -22,11 +22,9 @@ public class Main { System.exit(1); return; } - //TODO : change timeSlotNb and subCarrierNb - int timeSlotNb = 0; - int subCarrierNb = 0; + int timeSlotNb = 2; + int subCarrierNb = 100; List users = generateUsers(20, timeSlotNb, subCarrierNb); - //TODO : generate users ResourceBlock[][] frame = new ResourceBlock[timeSlotNb][subCarrierNb]; Scheduler scheduler = new RoundRobin("round robin", 0, frame, users); AccessPoint accessPoint = new AccessPoint(scheduler, frame, users, timeSlotNb, subCarrierNb, 0, 50);