From b0f96e4173a58bd87f58b964649d764ccb28b7d0 Mon Sep 17 00:00:00 2001 From: Loris Date: Fri, 24 Mar 2023 10:39:46 +0100 Subject: [PATCH 1/2] independent cell scheduler --- src/main/java/fr/ntr/Main.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/fr/ntr/Main.java b/src/main/java/fr/ntr/Main.java index cd498eb..dee5ce5 100644 --- a/src/main/java/fr/ntr/Main.java +++ b/src/main/java/fr/ntr/Main.java @@ -27,10 +27,12 @@ public class Main { for(int i = 2; i < maximumLoad; i+=2) { List users = generateUsers(i, timeSlotNb, subCarrierNb); ResourceBlock[][] frame = new ResourceBlock[timeSlotNb][subCarrierNb]; - Scheduler scheduler = new MaxSNR(frame, users); + //TODO : changes schedulers + Scheduler schedulerCell1 = new MaxSNR(frame, users); + Scheduler schedulerCell2 = new MaxSNR(frame, users); //TODO : modify cells parameters ? - Cell cell1 = new Cell(scheduler, frame, users, timeSlotNb, subCarrierNb, 0, 50); - Cell cell2 = new Cell(scheduler, frame, users, timeSlotNb, subCarrierNb, 0, 50); + Cell cell1 = new Cell(schedulerCell1, frame, users, timeSlotNb, subCarrierNb, 0, 50); + Cell cell2 = new Cell(schedulerCell2, frame, users, timeSlotNb, subCarrierNb, 0, 50); AccessPoint accessPoint = new AccessPoint(cell1, cell2); accessPoint.startSimulation(numberOfTicks); } From 12fc8e3a802402f81c665c931057b3ad6ec34364 Mon Sep 17 00:00:00 2001 From: Loris Date: Fri, 24 Mar 2023 10:52:33 +0100 Subject: [PATCH 2/2] un peu de javadoc plaisir --- src/main/java/fr/ntr/AccessPoint.java | 7 ++----- src/main/java/fr/ntr/Cell.java | 7 +++++-- src/main/java/fr/ntr/scheduler/MaxSNR.java | 2 -- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/fr/ntr/AccessPoint.java b/src/main/java/fr/ntr/AccessPoint.java index 985fea3..736a2aa 100644 --- a/src/main/java/fr/ntr/AccessPoint.java +++ b/src/main/java/fr/ntr/AccessPoint.java @@ -14,9 +14,7 @@ public class AccessPoint { private Cell cell1; private Cell cell2; - private List users; - private FileOutputStream outputDataFile; public AccessPoint(Cell cell1, Cell cell2){ @@ -29,6 +27,7 @@ public class AccessPoint { * @param duration */ public void startSimulation(int duration) { + /* try{ Files.deleteIfExists(Paths.get("export", this.users.size() + ".csv")); new File("export").mkdir(); @@ -39,6 +38,7 @@ public class AccessPoint { System.exit(1); return; } + */ for (int ticks = 0; ticks < duration; ++ticks) { // Simulation cell1.reset(); @@ -58,8 +58,6 @@ public class AccessPoint { } } - - /* private void analyseData(int tick) throws IOException { for(int i = 0; i < frame.length; i++) { @@ -80,5 +78,4 @@ public class AccessPoint { } */ - } diff --git a/src/main/java/fr/ntr/Cell.java b/src/main/java/fr/ntr/Cell.java index db3ecdb..0770e92 100644 --- a/src/main/java/fr/ntr/Cell.java +++ b/src/main/java/fr/ntr/Cell.java @@ -10,9 +10,12 @@ import java.util.Random; public class Cell { private List users; + /** + * scheduler utilisé par la cellule + */ private Scheduler scheduler; /** - * nombre de slots + * Nombre de slots */ private static int timeSlotNb; /** @@ -20,7 +23,7 @@ public class Cell { */ private static int subCarrierNb; /** - * trame + * Trame */ private ResourceBlock[][] frame; /** diff --git a/src/main/java/fr/ntr/scheduler/MaxSNR.java b/src/main/java/fr/ntr/scheduler/MaxSNR.java index 2d55916..2ecc0c5 100644 --- a/src/main/java/fr/ntr/scheduler/MaxSNR.java +++ b/src/main/java/fr/ntr/scheduler/MaxSNR.java @@ -7,10 +7,8 @@ import fr.ntr.User; public class MaxSNR extends Scheduler { private List users; - private ResourceBlock[][] frame; - public MaxSNR( ResourceBlock[][] frame, List users) { this.frame = frame; this.users = users;