Merge branch 'ajout_cellule' of gitlab.istic.univ-rennes1.fr:18008147/ntr into ajout_cellule

This commit is contained in:
Remi Boure 2023-03-30 09:41:15 +02:00
commit a654621085
5 changed files with 49 additions and 9 deletions

View File

@ -8,6 +8,8 @@ import java.nio.file.Paths;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import fr.ntr.Reuse.Reuse1;
import fr.ntr.Reuse.Reuse3;
import fr.ntr.scheduler.Scheduler; import fr.ntr.scheduler.Scheduler;
public class AccessPoint { public class AccessPoint {
@ -43,11 +45,15 @@ public class AccessPoint {
// Simulation // Simulation
cell1.reset(); cell1.reset();
cell2.reset(); cell2.reset();
cell1.updateBandwidth(ticks); List<Cell> cellList = null;
cell2.updateBandwidth(ticks); cellList.add(cell1);
cellList.add(cell2);
Reuse1.BandwithReuse1(cellList,ticks);
//Reuse3.BandwithReuse3(cellList,ticks);
cell1.schedule(); cell1.schedule();
cell2.schedule(); cell2.schedule();
//simulation des interférences //simulation des interférences
computeInterference(); computeInterference();

View File

@ -23,7 +23,7 @@ public class Cell {
/** /**
* Trame * Trame
*/ */
private final ResourceBlock[][] frame; private ResourceBlock[][] frame;
/** /**
* Reste pour la prochaine source * Reste pour la prochaine source
*/ */
@ -78,6 +78,10 @@ public class Cell {
return frame; return frame;
} }
public void setFrameSize(ResourceBlock[][] frame) {
this.frame=frame;
}
public static int getTimeSlotNb() { public static int getTimeSlotNb() {
return timeSlotNb; return timeSlotNb;
} }

View File

@ -17,13 +17,16 @@ public class ResourceBlock {
this.user = user; this.user = user;
} }
public User getUser() {
return user;
}
public void setBandwidth(double bandwidth) { public void setBandwidth(double bandwidth) {
this.bandwidth = bandwidth; this.bandwidth = bandwidth;
} }
public User getUser() {
return user;
}
public double getBandwidth() { public double getBandwidth() {
return bandwidth; return bandwidth;

View File

@ -1,5 +1,16 @@
package fr.ntr.Reuse; package fr.ntr.Reuse;
import fr.ntr.Cell;
import fr.ntr.User;
import java.util.List;
public class Reuse1 { public class Reuse1 {
//TODO Reuse1
public static void BandwithReuse1(List<Cell> cellList, int tick) {
for (Cell cell : cellList) {
cell.updateBandwidth(tick);
}
}
} }

View File

@ -1,6 +1,22 @@
package fr.ntr.Reuse; package fr.ntr.Reuse;
import fr.ntr.Cell;
import fr.ntr.ResourceBlock;
import fr.ntr.User;
import java.util.List;
public class Reuse3 { public class Reuse3 {
//TODO Reuse3 //TODO Reuse3
public static void BandwithReuse3(List<Cell> cellList, int tick) {
for (Cell cell : cellList) {
//TODO set size
//cell.setFrameSize(cellList.size());
cell.updateBandwidth(tick);
}
}
} }