From bdb674a63fae732b0fa426a069e1d1863f5a5878 Mon Sep 17 00:00:00 2001 From: Tr1xt4n Date: Fri, 10 Mar 2023 11:55:01 +0100 Subject: [PATCH] MaxSnr v1 --- src/main/java/fr/ntr/scheduler/MaxSNR.java | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/main/java/fr/ntr/scheduler/MaxSNR.java b/src/main/java/fr/ntr/scheduler/MaxSNR.java index d825ec1..2a1fefe 100644 --- a/src/main/java/fr/ntr/scheduler/MaxSNR.java +++ b/src/main/java/fr/ntr/scheduler/MaxSNR.java @@ -1,23 +1,34 @@ package fr.ntr.scheduler; import java.util.List; + +import fr.ntr.AccessPoint; +import fr.ntr.User; import fr.ntr.UserGroup; public class MaxSNR extends Scheduler { - private String name; - - + private List users; + @Override public void scheduling() { + User userMax = null; + for(int ts = 0; ts < 2; i++){ + for(int sp = 0; sp < 100; j++){ + userMax = selectionUtilisateur(sp, ts, users); + } + } } - private void selectionUtilisateur(int Ts, int Sp, List Users) { - + private User selectionUtilisateur(int sp, int ts, List Users) { + double MaxSnr = 0.0; + User userMax = null; + for(User u: Users){ + if (MaxSnr < u.getBandwidthTable()[ts][sp]){ + MaxSnr = u.getBandwidthTable()[ts][sp]; + userMax = u; + } + } + return userMax; } - public MaxSNR(String name) { - this.name = name; - } - - }