diff --git a/src/main/java/fr/ntr/scheduler/MaxSNR.java b/src/main/java/fr/ntr/scheduler/MaxSNR.java index 809cd99..c56f9e5 100644 --- a/src/main/java/fr/ntr/scheduler/MaxSNR.java +++ b/src/main/java/fr/ntr/scheduler/MaxSNR.java @@ -35,10 +35,12 @@ public class MaxSNR extends Scheduler { private User userSelection(int ts, int sp) { double maxSnr = 0.0; User userMax = null; - for(User u: users){ - if (maxSnr < u.getBandwidthTable()[ts][sp]) { - maxSnr = u.getBandwidthTable()[ts][sp]; - userMax = u; + for(User u: users) { + if (!u.getPacketsToSend().isEmpty()) { + if (maxSnr < u.getBandwidthTable()[ts][sp]) { + maxSnr = u.getBandwidthTable()[ts][sp]; + userMax = u; + } } } return userMax;