From 21815c03da0dbacea1b946ed48591dca148b7e51 Mon Sep 17 00:00:00 2001 From: Tr1xt4n Date: Fri, 31 Mar 2023 09:49:42 +0200 Subject: [PATCH] fix SNR --- src/main/java/fr/ntr/scheduler/MaxSNR.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/fr/ntr/scheduler/MaxSNR.java b/src/main/java/fr/ntr/scheduler/MaxSNR.java index ae5090c..9a8ab40 100644 --- a/src/main/java/fr/ntr/scheduler/MaxSNR.java +++ b/src/main/java/fr/ntr/scheduler/MaxSNR.java @@ -35,9 +35,11 @@ public class MaxSNR extends Scheduler { double maxSnr = 0.0; User userMax = null; for(User u: users){ - if (maxSnr < u.getBandwidthTable()[ts][sp]) { - maxSnr = u.getBandwidthTable()[ts][sp]; - userMax = u; + if(!u.getPacketsToSend().isEmpty()) { + if (maxSnr < u.getBandwidthTable()[ts][sp]) { + maxSnr = u.getBandwidthTable()[ts][sp]; + userMax = u; + } } } return userMax;