diff --git a/src/main/java/fr/ntr/Cell.java b/src/main/java/fr/ntr/Cell.java index b96e822..64229e0 100644 --- a/src/main/java/fr/ntr/Cell.java +++ b/src/main/java/fr/ntr/Cell.java @@ -1,53 +1,14 @@ package fr.ntr; import fr.ntr.scheduler.MaxSNR; -import fr.ntr.scheduler.RoundRobin; import fr.ntr.scheduler.Scheduler; import java.util.ArrayList; import java.util.List; - - public class Cell { - private int maximumLoad; - private int numberOfTicks; - private List Users; - public Cell(){ - this.maximumLoad=0; - this.numberOfTicks=0; - this.Users=null; - } + public static void createCell() { - 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 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 generateUsers(int nbUsers, int timeSlotNb, int subCarrierNb) { - List 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; - } - } \ No newline at end of file diff --git a/src/main/java/fr/ntr/Main.java b/src/main/java/fr/ntr/Main.java index 22a05e8..a37612a 100644 --- a/src/main/java/fr/ntr/Main.java +++ b/src/main/java/fr/ntr/Main.java @@ -15,6 +15,7 @@ public class Main { public static void main(String[] args) { if(args.length == 2) { + int numberOfTicks; // Nombre de ticks de la simulation -> durée de la simulation int maximumLoad; // Nombre maximal d'utilisateurs dans le système try {