diff --git a/src/main/java/fr/ntr/AccessPoint.java b/src/main/java/fr/ntr/AccessPoint.java index 1a79222..8592b0f 100644 --- a/src/main/java/fr/ntr/AccessPoint.java +++ b/src/main/java/fr/ntr/AccessPoint.java @@ -31,12 +31,14 @@ public class AccessPoint { private final double min, max; - public AccessPoint(Scheduler scheduler, double min, double max) { + public AccessPoint(Scheduler scheduler, ResourceBlock[][] frame, int timeSlotNb, int subCarrierNb, double min, double max) { this.min = min; this.max = max; this.users = new ArrayList<>(); this.scheduler = scheduler; - this.frame = new ResourceBlock[timeSlotNb][subCarrierNb]; + this.frame = frame; + this.timeSlotNb = timeSlotNb; + this.subCarrierNb = subCarrierNb; } /** diff --git a/src/main/java/fr/ntr/Main.java b/src/main/java/fr/ntr/Main.java index 3796cd7..e72e29d 100644 --- a/src/main/java/fr/ntr/Main.java +++ b/src/main/java/fr/ntr/Main.java @@ -1,11 +1,11 @@ package fr.ntr; import fr.ntr.scheduler.RoundRobin; +import fr.ntr.scheduler.Scheduler; public class Main { public static void main(String[] args) { - //TODO ajouter accès à AccessPoint if(args.length == 2) { int numberOfTicks; // Nombre de ticks de la simulation -> durée de la simulation @@ -19,8 +19,12 @@ public class Main { System.exit(1); return; } - - AccessPoint accessPoint = new AccessPoint(new RoundRobin("round robin", 0), 0, 50); + //TODO : change timeSlotNb and subCarrierNb + int timeSlotNb = 0; + int subCarrierNb = 0; + ResourceBlock[][] frame = new ResourceBlock[timeSlotNb][subCarrierNb]; + Scheduler scheduler = new RoundRobin("round robin", 0, frame); + AccessPoint accessPoint = new AccessPoint(scheduler, frame, timeSlotNb, subCarrierNb, 0, 50); accessPoint.startSimulation(numberOfTicks, maximumLoad); } else { System.err.println("Please give launch arguments"); diff --git a/src/main/java/fr/ntr/scheduler/RoundRobin.java b/src/main/java/fr/ntr/scheduler/RoundRobin.java index 163e1c0..f2ff2b1 100644 --- a/src/main/java/fr/ntr/scheduler/RoundRobin.java +++ b/src/main/java/fr/ntr/scheduler/RoundRobin.java @@ -15,9 +15,10 @@ public class RoundRobin extends Scheduler { private List users; private ResourceBlock[][] frame; - public RoundRobin(String name, int index) { + public RoundRobin(String name, int index, ResourceBlock[][] frame) { this.name = name; this.index = index; + this.frame = frame; } /**