MaxSnr v1
This commit is contained in:
parent
7e79e7d30e
commit
bdb674a63f
@ -1,23 +1,34 @@
|
|||||||
package fr.ntr.scheduler;
|
package fr.ntr.scheduler;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import fr.ntr.AccessPoint;
|
||||||
|
import fr.ntr.User;
|
||||||
import fr.ntr.UserGroup;
|
import fr.ntr.UserGroup;
|
||||||
|
|
||||||
public class MaxSNR extends Scheduler {
|
public class MaxSNR extends Scheduler {
|
||||||
|
|
||||||
private String name;
|
private List<User> users;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void scheduling() {
|
public void scheduling() {
|
||||||
|
User userMax = null;
|
||||||
|
for(int ts = 0; ts < 2; i++){
|
||||||
|
for(int sp = 0; sp < 100; j++){
|
||||||
|
userMax = selectionUtilisateur(sp, ts, users);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectionUtilisateur(int Ts, int Sp, List<User> Users) {
|
private User selectionUtilisateur(int sp, int ts, List<User> Users) {
|
||||||
|
double MaxSnr = 0.0;
|
||||||
|
User userMax = null;
|
||||||
|
for(User u: Users){
|
||||||
|
if (MaxSnr < u.getBandwidthTable()[ts][sp]){
|
||||||
|
MaxSnr = u.getBandwidthTable()[ts][sp];
|
||||||
|
userMax = u;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return userMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaxSNR(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user