From 7cfad0a81c3c999d874c14101b53bbcebd64b6bd Mon Sep 17 00:00:00 2001 From: Remi Boure Date: Fri, 10 Mar 2023 09:12:36 +0100 Subject: [PATCH] set fixed distance values --- build.gradle | 2 +- src/main/java/fr/ntr/AccessPoint.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index b851d38..079c0fe 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ plugins { } run { - args = ["5000", "20"] + args = ["5000", "2"] } application { diff --git a/src/main/java/fr/ntr/AccessPoint.java b/src/main/java/fr/ntr/AccessPoint.java index 976ab7d..d532729 100644 --- a/src/main/java/fr/ntr/AccessPoint.java +++ b/src/main/java/fr/ntr/AccessPoint.java @@ -60,10 +60,9 @@ public class AccessPoint { * Génération du débit et des paquets */ private void init(int nbUsers) { + double[] distance = { 200d, 500d }; for (int i = 0; i < nbUsers; i++) { - Random random = new Random(); - double randomDist = this.min + random.nextDouble() * (this.max - this.min); - User user = new User(randomDist); + User user = new User(distance[i]); user.generateBandwidth(); user.createPackets(); this.users.add(user);