diff --git a/src/main/java/fr/ntr/AccessPoint.java b/src/main/java/fr/ntr/AccessPoint.java index ce47e14..92fad87 100644 --- a/src/main/java/fr/ntr/AccessPoint.java +++ b/src/main/java/fr/ntr/AccessPoint.java @@ -54,4 +54,4 @@ public class AccessPoint { public int getFrameSize(){ return this.timeSlotNb * this.subCarrierNb; } -} +} \ No newline at end of file diff --git a/src/main/java/fr/ntr/Main.java b/src/main/java/fr/ntr/Main.java index 06e6613..ff789fa 100644 --- a/src/main/java/fr/ntr/Main.java +++ b/src/main/java/fr/ntr/Main.java @@ -19,4 +19,4 @@ public class Main { System.out.println("Hello World"); } -} +} \ No newline at end of file diff --git a/src/main/java/fr/ntr/Packets.java b/src/main/java/fr/ntr/Packets.java index d52ecab..3036906 100644 --- a/src/main/java/fr/ntr/Packets.java +++ b/src/main/java/fr/ntr/Packets.java @@ -13,4 +13,4 @@ public class Packets { this.bitsNumberRemaining = bitsNumberRemaining; this.user = user; } -} +} \ No newline at end of file diff --git a/src/main/java/fr/ntr/scheduler/MaxSNR.java b/src/main/java/fr/ntr/scheduler/MaxSNR.java index 41e0ceb..d81bb8a 100644 --- a/src/main/java/fr/ntr/scheduler/MaxSNR.java +++ b/src/main/java/fr/ntr/scheduler/MaxSNR.java @@ -5,14 +5,22 @@ import fr.ntr.User; public class MaxSNR extends Scheduler { private String name; - - + @Override public void scheduling() { } - private void selectionUtilisateur(int Ts, int Sp, List Users) { - + private User selectionUtilisateur(int Ts, int Sp, List Users) { + User selectedUser = null; + double maxSNR= 0; + for (User user : Users) { + double snr = (Math.log(1 + effSpect) / Math.log(2)); + if (snr > maxSNR) { + maxSNR = snr; + selectedUser = user; + } + } + return selectedUser; } public MaxSNR(String name) { diff --git a/src/main/java/fr/ntr/scheduler/RoundRobin.java b/src/main/java/fr/ntr/scheduler/RoundRobin.java index 1db8218..0d19b57 100644 --- a/src/main/java/fr/ntr/scheduler/RoundRobin.java +++ b/src/main/java/fr/ntr/scheduler/RoundRobin.java @@ -22,12 +22,5 @@ public class RoundRobin extends Scheduler { //Sp =sous porteuse private void selectionUtilisateur(int Ts, int Sp, List Users) { int random = new Random().nextInt(0, Users.size()-1); - - } - - - - - }