Try RR
This commit is contained in:
parent
74bcba2de3
commit
de14f7b710
@ -118,7 +118,7 @@ public class AccessPoint {
|
||||
}
|
||||
|
||||
private void reset() {
|
||||
this.frame = new ResourceBlock[timeSlotNb][subCarrierNb];
|
||||
// TODO insert new UR
|
||||
}
|
||||
|
||||
public int getFrameSize() {
|
||||
|
@ -36,16 +36,15 @@ public class RoundRobin extends Scheduler {
|
||||
//Pour chaque time slot et sous porteuses
|
||||
for (int Ts = 0; Ts < AccessPoint.getTimeSlotNb(); Ts++) {
|
||||
for(int Sp = 0; Sp < AccessPoint.getSubCarrierNb(); Sp++) {
|
||||
if (users.get(index).getPacketsToSend().size() != 0) {
|
||||
// on enlève le packet transmis de la liste
|
||||
// TODO Verify sub the packet send need Set packet
|
||||
users.get(index).getPacketsSent().add(users.get(index).getPacketsToSend().get(0));
|
||||
users.get(index).getPacketsToSend().remove(users.get(index).getPacketsToSend().get(0));
|
||||
//on ajoute l'utilisateur a la frame
|
||||
frame[Ts][Sp].setUser(UserSelection(Ts, Sp, users));
|
||||
//si un utilisateur n'a plus de packet a transmettre on supprime l'utilisateur de la liste
|
||||
if (users.get(index).getPacketsToSend() == null) {
|
||||
users.remove(index);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user