fix packet
This commit is contained in:
parent
71464a15d7
commit
077ef9aca8
@ -15,7 +15,7 @@ public abstract class Scheduler {
|
|||||||
|
|
||||||
protected void allocateRessource(User userMax, ResourceBlock[][] frame, int ts, int sp, int ticks) {
|
protected void allocateRessource(User userMax, ResourceBlock[][] frame, int ts, int sp, int ticks) {
|
||||||
if (userMax != null && !userMax.getPacketsToSend().isEmpty()) {
|
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){
|
if(p.getBitsNumberRemaining() > 0){
|
||||||
p.decreaseBitsNumberRemaining((int) userMax.getBandwidthTable()[ts][sp]);
|
p.decreaseBitsNumberRemaining((int) userMax.getBandwidthTable()[ts][sp]);
|
||||||
} else {
|
} else {
|
||||||
@ -31,4 +31,4 @@ public abstract class Scheduler {
|
|||||||
frame[ts][sp].setBandwidth(userMax.getBandwidthTable()[ts][sp]);
|
frame[ts][sp].setBandwidth(userMax.getBandwidthTable()[ts][sp]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user