This commit is contained in:
Tr1xt4n 2023-03-10 09:17:15 +01:00
parent 362684f1f8
commit 69203e1646
5 changed files with 15 additions and 14 deletions

View File

@ -6,13 +6,21 @@ public class MaxSNR extends Scheduler {
private String name; private String name;
@Override @Override
public void scheduling() { public void scheduling() {
} }
private void selectionUtilisateur(int Ts, int Sp, List<User> Users) { private User selectionUtilisateur(int Ts, int Sp, List<User> Users) {
User selectedUser = null;
double maxSNR= 0;
for (User user : Users) {
double snr = (Math.log(1 + effSpect) / Math.log(2));
if (snr > maxSNR) {
maxSNR = snr;
selectedUser = user;
}
}
return selectedUser;
} }
public MaxSNR(String name) { public MaxSNR(String name) {

View File

@ -22,12 +22,5 @@ public class RoundRobin extends Scheduler {
//Sp =sous porteuse //Sp =sous porteuse
private void selectionUtilisateur(int Ts, int Sp, List<User> Users) { private void selectionUtilisateur(int Ts, int Sp, List<User> Users) {
int random = new Random().nextInt(0, Users.size()-1); int random = new Random().nextInt(0, Users.size()-1);
} }
} }