Main now call AccessPoint and start the simulation
This commit is contained in:
parent
f9cea33e9f
commit
01b82d7ef4
@ -14,7 +14,7 @@ public class AccessPoint {
|
||||
*/
|
||||
private static int timeSlotNb;
|
||||
/**
|
||||
* nombre de sous-porteuses
|
||||
* Nombre de sous-porteuses
|
||||
*/
|
||||
private static int subCarrierNb;
|
||||
/**
|
||||
@ -22,11 +22,11 @@ public class AccessPoint {
|
||||
*/
|
||||
private ResourceBlock[][] frame;
|
||||
/**
|
||||
* reste pour la prochaine source
|
||||
* Reste pour la prochaine source
|
||||
*/
|
||||
private double leftForNextSource;
|
||||
/**
|
||||
* portée minimum et maximum de l'antenne
|
||||
* Portée minimum et maximum de l'antenne
|
||||
*/
|
||||
private final double min, max;
|
||||
|
||||
@ -34,7 +34,7 @@ public class AccessPoint {
|
||||
public AccessPoint(Scheduler scheduler, double min, double max) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.users = new ArrayList<User>();
|
||||
this.users = new ArrayList<>();
|
||||
this.scheduler = scheduler;
|
||||
this.frame = new ResourceBlock[timeSlotNb][subCarrierNb];
|
||||
}
|
||||
|
@ -1,24 +1,15 @@
|
||||
package fr.ntr;
|
||||
|
||||
import fr.ntr.scheduler.RoundRobin;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
/**
|
||||
* Nombre de ticks de la simulation
|
||||
* -> durée de la simulation
|
||||
*/
|
||||
int numberOfTicks = 5000;
|
||||
|
||||
/**
|
||||
* Nombre maximal d'utilisateurs dans le système
|
||||
*/
|
||||
int maximumLoad = 20;
|
||||
|
||||
|
||||
//TODO ajouter accès à AccessPoint
|
||||
|
||||
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 {
|
||||
numberOfTicks = Integer.parseInt(args[0]);
|
||||
maximumLoad = Integer.parseInt(args[1]);
|
||||
@ -26,7 +17,10 @@ public class Main {
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("Cannot parse launch argument to integer");
|
||||
System.exit(1);
|
||||
return;
|
||||
}
|
||||
AccessPoint accessPoint = new AccessPoint(new RoundRobin("round robin", 0), 0, 50);
|
||||
accessPoint.startSimulation(numberOfTicks, maximumLoad);
|
||||
} else {
|
||||
System.err.println("Please give launch arguments");
|
||||
System.err.println("gradle run --args=\"<number of ticks> <number of users>\"");
|
||||
|
Reference in New Issue
Block a user