From 81f9739a8cdc7b877f338c942938518704cc530a Mon Sep 17 00:00:00 2001 From: iboyeau Date: Fri, 24 Mar 2023 11:55:39 +0100 Subject: [PATCH] javadoc and few warning suppression --- src/main/java/fr/ntr/Cell.java | 2 -- src/main/java/fr/ntr/scheduler/MaxSNR.java | 10 ++++++++-- .../java/fr/ntr/scheduler/RoundRobin.java | 20 ++++++++++--------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/main/java/fr/ntr/Cell.java b/src/main/java/fr/ntr/Cell.java index db3ecdb..65bf78c 100644 --- a/src/main/java/fr/ntr/Cell.java +++ b/src/main/java/fr/ntr/Cell.java @@ -1,9 +1,7 @@ package fr.ntr; -import fr.ntr.scheduler.MaxSNR; import fr.ntr.scheduler.Scheduler; -import java.util.ArrayList; import java.util.List; import java.util.Random; diff --git a/src/main/java/fr/ntr/scheduler/MaxSNR.java b/src/main/java/fr/ntr/scheduler/MaxSNR.java index 2d55916..be11b54 100644 --- a/src/main/java/fr/ntr/scheduler/MaxSNR.java +++ b/src/main/java/fr/ntr/scheduler/MaxSNR.java @@ -30,8 +30,14 @@ public class MaxSNR extends Scheduler { } } } - } - + } + + /** + * @param ts Time slot (int) + * @param sp Sous porteuse(int) + * @param Users (List) + * Return + */ private User selectionUtilisateur(int sp, int ts, List Users) { double MaxSnr = 0.0; User userMax = null; diff --git a/src/main/java/fr/ntr/scheduler/RoundRobin.java b/src/main/java/fr/ntr/scheduler/RoundRobin.java index d1e138b..1eba846 100644 --- a/src/main/java/fr/ntr/scheduler/RoundRobin.java +++ b/src/main/java/fr/ntr/scheduler/RoundRobin.java @@ -34,17 +34,17 @@ public class RoundRobin extends Scheduler { index = random.nextInt(users.size()); //Pour chaque time slot et sous porteuses - for (int Ts = 0; Ts < Cell.getTimeSlotNb(); Ts++) { - for(int Sp = 0; Sp < Cell.getSubCarrierNb(); Sp++) { + for (int ts = 0; ts < Cell.getTimeSlotNb(); ts++) { + for(int sp = 0; sp < Cell.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 - User user = UserSelection(Ts, Sp, users); - frame[Ts][Sp].setUser(user); - frame[Ts][Sp].setBandwidth(user.getBandwidthTable()[Ts][Sp]); + User user = UserSelection(ts, sp, users); + frame[ts][sp].setUser(user); + frame[ts][sp].setBandwidth(user.getBandwidthTable()[ts][sp]); } } @@ -52,13 +52,15 @@ public class RoundRobin extends Scheduler { } /** - * Entry Time slot (int), Sous porteuse(int), and users ( List) + * @param ts Time slot (int) + * @param sp Sous porteuse(int) + * @param Users (List) * Return the user in function of TS and SP selected */ - private User UserSelection(int Ts, int Sp, List users) { + private User UserSelection(int ts, int sp, List Users) { //compte le nombre de bloc attribue - for (int i = 0; i < Ts; i++){ - for (int j = 0; j < Sp; j++) { + for (int i = 0; i < ts; i++){ + for (int j = 0; j < sp; j++) { index++; } }