dirty reuse

This commit is contained in:
iboyeau 2023-03-31 06:18:40 +02:00
parent 51b578036d
commit 1430d4afe5

View File

@ -14,6 +14,11 @@ public class Main {
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
//TODO make this cleanly
boolean reuse3=false;//reuse 1 par def sinon reuse 3
int nbcell = 2; //nombre de cellule que l'on va utilise
try { try {
numberOfTicks = Integer.parseInt(args[0]); numberOfTicks = Integer.parseInt(args[0]);
maximumLoad = Integer.parseInt(args[1]); maximumLoad = Integer.parseInt(args[1]);
@ -28,18 +33,23 @@ public class Main {
for(int i = 2; i < maximumLoad; i += 2) { for(int i = 2; i < maximumLoad; i += 2) {
List<User> users = generateUsers(i, timeSlotNb, subCarrierNb); List<User> users = generateUsers(i, timeSlotNb, subCarrierNb);
//TODO reuse choise //reuse choise
ResourceBlock[][] frame;
if(reuse3){
frame = new ResourceBlock[timeSlotNb/nbcell][subCarrierNb];
} else {
frame = new ResourceBlock[timeSlotNb][subCarrierNb];
}
ResourceBlock[][] frame = new ResourceBlock[timeSlotNb/2][subCarrierNb]; //TODO : changes schedulers
//TODO : changes schedulers
Scheduler schedulerCell1 = new MaxSNR(frame, users); Scheduler schedulerCell1 = new MaxSNR(frame, users);
Scheduler schedulerCell2 = new MaxSNR(frame, users); Scheduler schedulerCell2 = new MaxSNR(frame, users);
//TODO : modify cells parameters ? //TODO : modify cells parameters ?
Cell cell1 = new Cell(schedulerCell1, frame, users, timeSlotNb, subCarrierNb, 0, 50); Cell cell1 = new Cell(schedulerCell1, frame, users, timeSlotNb, subCarrierNb, 0, 50);
Cell cell2 = new Cell(schedulerCell2, frame, users, timeSlotNb, subCarrierNb, 0, 50); Cell cell2 = new Cell(schedulerCell2, frame, users, timeSlotNb, subCarrierNb, 0, 50);
AccessPoint accessPoint = new AccessPoint(cell1, cell2); AccessPoint accessPoint = new AccessPoint(cell1, cell2);
accessPoint.startSimulation(numberOfTicks); accessPoint.startSimulation(numberOfTicks);
} }
} }
else { else {