Fix for jdk 1.8
This commit is contained in:
parent
df77238cc9
commit
9936d4f1b9
@ -12,6 +12,7 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class Main {
|
||||
|
||||
@ -52,7 +53,7 @@ public class Main {
|
||||
});
|
||||
Cell.setTimeSlotNb(timeSlotNb);
|
||||
Cell.setSubCarrierNb(subCarrierNb);
|
||||
try(ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())) {
|
||||
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||
for(int i = 2; i <= maximumLoad; i += 2) {
|
||||
List<User> users = generateUsers(i, timeSlotNb, subCarrierNb);
|
||||
ResourceBlock[][] frame = new ResourceBlock[timeSlotNb][subCarrierNb];
|
||||
@ -72,7 +73,13 @@ public class Main {
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
executor.shutdown();
|
||||
try {
|
||||
executor.awaitTermination(2, TimeUnit.MINUTES);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
executor.shutdownNow();
|
||||
} else {
|
||||
System.err.println("Please give launch arguments");
|
||||
System.err.println("gradle run --args=\"<number of ticks> <number of users>\"");
|
||||
|
@ -45,9 +45,9 @@ public class User {
|
||||
public void createPackets(int m, int ticks) {
|
||||
timeInterval--;
|
||||
if(timeInterval == 0) {
|
||||
timeInterval = random.nextInt(50, 101);
|
||||
timeInterval = 50 + random.nextInt(51);
|
||||
// On tire un nombre entre 0 et 2 * m
|
||||
mbis = random.nextInt(1, 2 * m + 1) ;
|
||||
mbis = 1 + random.nextInt(2 * m + 1) ;
|
||||
|
||||
}
|
||||
// On calcule le nombre de paquets qu'on peut transmettre
|
||||
|
Reference in New Issue
Block a user