From 825f4f26c7acdd9bc1ffe852010b445da34e5aad Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Fri, 7 Apr 2023 11:39:35 +0200 Subject: [PATCH] Fix reuse --- src/main/java/fr/ntr/AccessPoint.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/ntr/AccessPoint.java b/src/main/java/fr/ntr/AccessPoint.java index 6ca436d..d5ded6d 100644 --- a/src/main/java/fr/ntr/AccessPoint.java +++ b/src/main/java/fr/ntr/AccessPoint.java @@ -29,9 +29,9 @@ public class AccessPoint { cell1.preScheduling(); cell2.preScheduling(); for(int ts = 0; ts < Cell.getTimeSlotNb(); ts++) { - for (int sp = 0; sp < (reuse3 ? Cell.getSubCarrierNb() : Cell.getSubCarrierNb()/2); sp++) { + for (int sp = 0; sp < (reuse3 ? Cell.getSubCarrierNb() / 2 : Cell.getSubCarrierNb()); sp++) { User user1 = cell1.schedule(ticks, ts, sp); - User user2 = cell2.schedule(ticks, ts, reuse3 ? 0 : 50 + sp); + User user2 = cell2.schedule(ticks, ts, (reuse3 ? 50 : 0) + sp); boolean haveInterference = user1 == user2 && user1 != null; cell1.consumeResource(ticks, ts, sp, haveInterference); cell2.consumeResource(ticks, ts, sp, haveInterference);