=roll back

This commit is contained in:
iboyeau 2023-03-24 11:13:42 +01:00
parent 4c33dac028
commit 613510c6d0
2 changed files with 2 additions and 40 deletions

View File

@ -1,53 +1,14 @@
package fr.ntr; package fr.ntr;
import fr.ntr.scheduler.MaxSNR; import fr.ntr.scheduler.MaxSNR;
import fr.ntr.scheduler.RoundRobin;
import fr.ntr.scheduler.Scheduler; import fr.ntr.scheduler.Scheduler;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class Cell { public class Cell {
private int maximumLoad;
private int numberOfTicks;
private List<User> Users;
public Cell(){ public static void createCell() {
this.maximumLoad=0;
this.numberOfTicks=0;
this.Users=null;
}
public Cell createCell(int maximumLoad,int numberOfTicks) {
Cell currentCell = new Cell();
currentCell.maximumLoad=maximumLoad;
currentCell.numberOfTicks=numberOfTicks;
int timeSlotNb = 2;
int subCarrierNb = 100;
for(int i = 2; i < maximumLoad; i+=2) {
List<User> users = generateUsers(i, timeSlotNb, subCarrierNb);
currentCell.Users=users;
ResourceBlock[][] frame = new ResourceBlock[timeSlotNb][subCarrierNb];
//Scheduler scheduler = new RoundRobin("round robin", 0, frame, users);
Scheduler scheduler = new MaxSNR(frame, users);
AccessPoint accessPoint = new AccessPoint(scheduler, frame, users, timeSlotNb, subCarrierNb, 0, 50);
accessPoint.startSimulation(numberOfTicks);
}
return currentCell;
}
private static List<User> generateUsers(int nbUsers, int timeSlotNb, int subCarrierNb) {
List<User> users = new ArrayList<>();
// 2 groupes d'utilisateurs, proches et éloignés
double[] distance = { 200d, 1000d };
for (double v : distance) {
for (int j = 0; j < nbUsers; j++) {
User user = new User(v, timeSlotNb, subCarrierNb);
users.add(user);
}
}
return users;
}
} }
}

View File

@ -15,6 +15,7 @@ public class Main {
public static void main(String[] args) { public static void main(String[] args) {
if(args.length == 2) { if(args.length == 2) {
int numberOfTicks; // Nombre de ticks de la simulation -> durée de la simulation int numberOfTicks; // Nombre de ticks de la simulation -> durée de la simulation
int maximumLoad; // Nombre maximal d'utilisateurs dans le système int maximumLoad; // Nombre maximal d'utilisateurs dans le système
try { try {