get/set RessourceBock
This commit is contained in:
parent
01b82d7ef4
commit
28f14a5447
@ -1,5 +1,6 @@
|
|||||||
package fr.ntr;
|
package fr.ntr;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@ -30,7 +31,7 @@ public class AccessPoint {
|
|||||||
*/
|
*/
|
||||||
private final double min, max;
|
private final double min, max;
|
||||||
|
|
||||||
|
|
||||||
public AccessPoint(Scheduler scheduler, double min, double max) {
|
public AccessPoint(Scheduler scheduler, double min, double max) {
|
||||||
this.min = min;
|
this.min = min;
|
||||||
this.max = max;
|
this.max = max;
|
||||||
@ -41,10 +42,11 @@ public class AccessPoint {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Lancer la simulation
|
* Lancer la simulation
|
||||||
|
*
|
||||||
* @param duration
|
* @param duration
|
||||||
*/
|
*/
|
||||||
public void startSimulation(int duration, int nbUsers){
|
public void startSimulation(int duration, int nbUsers) {
|
||||||
for(int ticks = 0; ticks < duration; ++ticks){
|
for (int ticks = 0; ticks < duration; ++ticks) {
|
||||||
// Simulation
|
// Simulation
|
||||||
reset();
|
reset();
|
||||||
init(nbUsers);
|
init(nbUsers);
|
||||||
@ -57,8 +59,8 @@ public class AccessPoint {
|
|||||||
/**
|
/**
|
||||||
* Génération du débit et des paquets
|
* Génération du débit et des paquets
|
||||||
*/
|
*/
|
||||||
private void init(int nbUsers){
|
private void init(int nbUsers) {
|
||||||
for(int i = 0; i < nbUsers; i++){
|
for (int i = 0; i < nbUsers; i++) {
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
double randomDist = this.min + random.nextDouble() * (this.max - this.min);
|
double randomDist = this.min + random.nextDouble() * (this.max - this.min);
|
||||||
User user = new User(randomDist);
|
User user = new User(randomDist);
|
||||||
@ -68,23 +70,30 @@ public class AccessPoint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void schedule(){
|
private void schedule() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void analyseData(){
|
private void analyseData() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void plotData(){
|
private void plotData() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reset(){
|
private void reset() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getFrameSize(){
|
public int getFrameSize() {
|
||||||
return this.timeSlotNb * this.subCarrierNb;
|
return this.timeSlotNb * this.subCarrierNb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResourceBlock[][] getFrame() {
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
public void setFrame(ResourceBlock[][] frame) {
|
||||||
|
this.frame = frame;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user