scheduleing +1param
This commit is contained in:
parent
2c5d1d2e94
commit
3a438472d0
@ -26,13 +26,12 @@ public class MaxSNR extends Scheduler {
|
||||
if (userMax.getPacketsToSend().size() != 0) {
|
||||
Packets p = userMax.getPacketsToSend().get(0);
|
||||
userMax.getPacketsSent().add(p);
|
||||
if(p.getDurationSending() != 0){
|
||||
if(p.getBitsNumberRemaining() > 0){
|
||||
p.decreaseBitsNumberRemaining((int) userMax.getBandwidthTable()[ts][sp]);
|
||||
} else {
|
||||
p.setDurationSending(ticks);
|
||||
}
|
||||
}
|
||||
if(p.getBitsNumberRemaining() > 0){
|
||||
p.decreaseBitsNumberRemaining((int) userMax.getBandwidthTable()[ts][sp]);
|
||||
} else {
|
||||
p.setDurationSending(ticks);
|
||||
}
|
||||
|
||||
userMax.getPacketsToSend().remove(p);
|
||||
frame[ts][sp].setUser(userMax);
|
||||
frame[ts][sp].setBandwidth(userMax.getBandwidthTable()[ts][sp]);
|
||||
|
@ -7,6 +7,8 @@ import fr.ntr.ResourceBlock;
|
||||
import fr.ntr.User;
|
||||
|
||||
public class ProportionalFair extends Scheduler {
|
||||
|
||||
|
||||
private List<User> users;
|
||||
|
||||
private ResourceBlock[][] frame;
|
||||
@ -17,7 +19,7 @@ public class ProportionalFair extends Scheduler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduling() {
|
||||
public void scheduling(int ticks) {
|
||||
ArrayList<Double> averageBandwiths = new ArrayList<Double>();
|
||||
for(User u : users){
|
||||
double avg = 0d;
|
||||
|
@ -28,7 +28,7 @@ public class RoundRobin extends Scheduler {
|
||||
* Return
|
||||
*/
|
||||
@Override
|
||||
public void scheduling() {
|
||||
public void scheduling(int ticks) {
|
||||
//selection aleatoire du premier utilisateur
|
||||
Random random = new Random();
|
||||
index = random.nextInt(users.size());
|
||||
|
Reference in New Issue
Block a user