This commit is contained in:
Quentin Legot 2023-03-17 12:00:01 +01:00
parent 74bcba2de3
commit de14f7b710
2 changed files with 9 additions and 10 deletions

View File

@ -118,7 +118,7 @@ public class AccessPoint {
}
private void reset() {
this.frame = new ResourceBlock[timeSlotNb][subCarrierNb];
// TODO insert new UR
}
public int getFrameSize() {

View File

@ -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);
}
}
}
}