fix packet

This commit is contained in:
Tr1xt4n 2023-03-31 11:27:12 +02:00
parent 71464a15d7
commit 077ef9aca8

View File

@ -15,7 +15,7 @@ public abstract class Scheduler {
protected void allocateRessource(User userMax, ResourceBlock[][] frame, int ts, int sp, int ticks) {
if (userMax != null && !userMax.getPacketsToSend().isEmpty()) {
Packets p = userMax.getPacketsToSend().get(0);
Packets p = userMax.getPacketsToSend().get(userMax.getPacketsToSend().size()-1);
if(p.getBitsNumberRemaining() > 0){
p.decreaseBitsNumberRemaining((int) userMax.getBandwidthTable()[ts][sp]);
} else {
@ -31,4 +31,4 @@ public abstract class Scheduler {
frame[ts][sp].setBandwidth(userMax.getBandwidthTable()[ts][sp]);
}
}
}
}