31 lines
1.1 KiB
Java
31 lines
1.1 KiB
Java
package fr.ntr;
|
|
|
|
import fr.ntr.scheduler.RoundRobin;
|
|
|
|
public class Main {
|
|
|
|
public static void main(String[] args) {
|
|
//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]);
|
|
System.out.println("ticks: " + numberOfTicks + ", users: " + maximumLoad);
|
|
} 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>\"");
|
|
System.exit(1);
|
|
}
|
|
}
|
|
}
|