Merge remote-tracking branch 'origin/ajout_cellule' into ajout_cellule
This commit is contained in:
commit
5586326358
@ -14,9 +14,7 @@ public class AccessPoint {
|
|||||||
|
|
||||||
private Cell cell1;
|
private Cell cell1;
|
||||||
private Cell cell2;
|
private Cell cell2;
|
||||||
|
|
||||||
private List<User> users;
|
private List<User> users;
|
||||||
|
|
||||||
private FileOutputStream outputDataFile;
|
private FileOutputStream outputDataFile;
|
||||||
|
|
||||||
public AccessPoint(Cell cell1, Cell cell2){
|
public AccessPoint(Cell cell1, Cell cell2){
|
||||||
@ -29,6 +27,7 @@ public class AccessPoint {
|
|||||||
* @param duration
|
* @param duration
|
||||||
*/
|
*/
|
||||||
public void startSimulation(int duration) {
|
public void startSimulation(int duration) {
|
||||||
|
/*
|
||||||
try{
|
try{
|
||||||
Files.deleteIfExists(Paths.get("export", this.users.size() + ".csv"));
|
Files.deleteIfExists(Paths.get("export", this.users.size() + ".csv"));
|
||||||
new File("export").mkdir();
|
new File("export").mkdir();
|
||||||
@ -39,6 +38,7 @@ public class AccessPoint {
|
|||||||
System.exit(1);
|
System.exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
for (int ticks = 0; ticks < duration; ++ticks) {
|
for (int ticks = 0; ticks < duration; ++ticks) {
|
||||||
// Simulation
|
// Simulation
|
||||||
cell1.reset();
|
cell1.reset();
|
||||||
@ -58,8 +58,6 @@ public class AccessPoint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
private void analyseData(int tick) throws IOException {
|
private void analyseData(int tick) throws IOException {
|
||||||
for(int i = 0; i < frame.length; i++) {
|
for(int i = 0; i < frame.length; i++) {
|
||||||
@ -80,5 +78,4 @@ public class AccessPoint {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,12 @@ import java.util.Random;
|
|||||||
public class Cell {
|
public class Cell {
|
||||||
|
|
||||||
private List<User> users;
|
private List<User> users;
|
||||||
|
/**
|
||||||
|
* scheduler utilisé par la cellule
|
||||||
|
*/
|
||||||
private Scheduler scheduler;
|
private Scheduler scheduler;
|
||||||
/**
|
/**
|
||||||
* nombre de slots
|
* Nombre de slots
|
||||||
*/
|
*/
|
||||||
private static int timeSlotNb;
|
private static int timeSlotNb;
|
||||||
/**
|
/**
|
||||||
@ -18,7 +21,7 @@ public class Cell {
|
|||||||
*/
|
*/
|
||||||
private static int subCarrierNb;
|
private static int subCarrierNb;
|
||||||
/**
|
/**
|
||||||
* trame
|
* Trame
|
||||||
*/
|
*/
|
||||||
private ResourceBlock[][] frame;
|
private ResourceBlock[][] frame;
|
||||||
/**
|
/**
|
||||||
|
@ -28,10 +28,12 @@ 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);
|
||||||
ResourceBlock[][] frame = new ResourceBlock[timeSlotNb][subCarrierNb];
|
ResourceBlock[][] frame = new ResourceBlock[timeSlotNb][subCarrierNb];
|
||||||
Scheduler scheduler = new MaxSNR(frame, users);
|
//TODO : changes schedulers
|
||||||
|
Scheduler schedulerCell1 = new MaxSNR(frame, users);
|
||||||
|
Scheduler schedulerCell2 = new MaxSNR(frame, users);
|
||||||
//TODO : modify cells parameters ?
|
//TODO : modify cells parameters ?
|
||||||
Cell cell1 = new Cell(scheduler, frame, users, timeSlotNb, subCarrierNb, 0, 50);
|
Cell cell1 = new Cell(schedulerCell1, frame, users, timeSlotNb, subCarrierNb, 0, 50);
|
||||||
Cell cell2 = new Cell(scheduler, 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);
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,8 @@ import fr.ntr.User;
|
|||||||
public class MaxSNR extends Scheduler {
|
public class MaxSNR extends Scheduler {
|
||||||
|
|
||||||
private List<User> users;
|
private List<User> users;
|
||||||
|
|
||||||
private ResourceBlock[][] frame;
|
private ResourceBlock[][] frame;
|
||||||
|
|
||||||
|
|
||||||
public MaxSNR( ResourceBlock[][] frame, List<User> users) {
|
public MaxSNR( ResourceBlock[][] frame, List<User> users) {
|
||||||
this.frame = frame;
|
this.frame = frame;
|
||||||
this.users = users;
|
this.users = users;
|
||||||
|
Reference in New Issue
Block a user