From 87b17274342d84b8e865f0e06336674715815623 Mon Sep 17 00:00:00 2001 From: iboyeau Date: Mon, 13 Mar 2023 15:06:13 +0100 Subject: [PATCH] Wip maj (okay i stop trying to optimise) roundRobin --- src/main/java/fr/ntr/scheduler/RoundRobin.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/fr/ntr/scheduler/RoundRobin.java b/src/main/java/fr/ntr/scheduler/RoundRobin.java index 4790b24..bb781de 100644 --- a/src/main/java/fr/ntr/scheduler/RoundRobin.java +++ b/src/main/java/fr/ntr/scheduler/RoundRobin.java @@ -56,13 +56,11 @@ public class RoundRobin extends Scheduler { private User UserSelection(int Ts, int Sp, List Users) { - //for (int i = 0; i < Ts; i++) { - // for (int j = 0; j < Sp; j++) { - // index++; - // } - //} - - index = (Ts + 1) * (Sp + 1); + for (int i = 0; i < Ts; i++){ + for (int j = 0; j < Sp; j++) { + index++; + } + } return Users.get(index%(Users.size() - 1)); }