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;