From f6407b1584aade0c220ce84d22fec92e1439f5c6 Mon Sep 17 00:00:00 2001 From: Loris Date: Thu, 30 Mar 2023 06:30:37 +0200 Subject: [PATCH 1/2] fixed comparison in computeInterference --- src/main/java/fr/ntr/AccessPoint.java | 6 +++--- src/main/java/fr/ntr/Main.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/ntr/AccessPoint.java b/src/main/java/fr/ntr/AccessPoint.java index 9981739..9569a6a 100644 --- a/src/main/java/fr/ntr/AccessPoint.java +++ b/src/main/java/fr/ntr/AccessPoint.java @@ -12,8 +12,8 @@ import fr.ntr.scheduler.Scheduler; public class AccessPoint { - private Cell cell1; - private Cell cell2; + private final Cell cell1; + private final Cell cell2; private List users; private FileOutputStream outputDataFile; @@ -75,7 +75,7 @@ public class AccessPoint { double bandwidth1 = frameCell1[k][l].getBandwidth(); double bandwidth2 = frameCell2[k][l].getBandwidth(); //User proche - if (user1.getDistance() > 200d) { + if (user1.getDistance() < 200d) { frameCell1[k][l].setBandwidth(bandwidth1 / 2); frameCell2[k][l].setBandwidth(bandwidth2 / 2); } diff --git a/src/main/java/fr/ntr/Main.java b/src/main/java/fr/ntr/Main.java index 8462de4..69b7bd2 100644 --- a/src/main/java/fr/ntr/Main.java +++ b/src/main/java/fr/ntr/Main.java @@ -25,7 +25,7 @@ public class Main { } int timeSlotNb = 2; int subCarrierNb = 100; - for(int i = 2; i < maximumLoad; i+=2) { + for(int i = 2; i < maximumLoad; i += 2) { List users = generateUsers(i, timeSlotNb, subCarrierNb); ResourceBlock[][] frame = new ResourceBlock[timeSlotNb][subCarrierNb]; //TODO : changes schedulers From 7620459a40656b0a05816745c6b6a546de4b81ec Mon Sep 17 00:00:00 2001 From: Remi Boure Date: Thu, 30 Mar 2023 08:38:35 +0200 Subject: [PATCH 2/2] Modifying bandwith of the user when interference --- src/main/java/fr/ntr/AccessPoint.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/ntr/AccessPoint.java b/src/main/java/fr/ntr/AccessPoint.java index ff0634d..99e6a14 100644 --- a/src/main/java/fr/ntr/AccessPoint.java +++ b/src/main/java/fr/ntr/AccessPoint.java @@ -76,13 +76,13 @@ public class AccessPoint { double bandwidth2 = frameCell2[k][l].getBandwidth(); //User proche if (user1.getDistance() > 200d) { - frameCell1[k][l].setBandwidth(bandwidth1 / 2); - frameCell2[k][l].setBandwidth(bandwidth2 / 2); + frameCell1[k][l].getUser().getBandwidthTable()[k][l] = bandwidth1 / 2; + frameCell2[k][l].getUser().getBandwidthTable()[k][l] = bandwidth2 / 2; } //User loin else { - frameCell1[k][l].setBandwidth(bandwidth1 / 4); - frameCell2[k][l].setBandwidth(bandwidth2 / 4); + frameCell1[k][l].getUser().getBandwidthTable()[k][l] = bandwidth1 / 4; + frameCell2[k][l].getUser().getBandwidthTable()[k][l] = bandwidth2 / 4; } } }