From 655f3a6642ec54d5181d281c266f50bc03226576 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Wed, 15 Feb 2023 14:19:21 +0100 Subject: [PATCH] fix: avoid looking into the future Checking neigh.receiving is cheating in the current model. If the timeslot is small, information can't propagate that fast. Signed-off-by: Csaba Kiraly --- DAS/validator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DAS/validator.py b/DAS/validator.py index 5af772a..8923a9a 100644 --- a/DAS/validator.py +++ b/DAS/validator.py @@ -344,7 +344,7 @@ class Validator: i = cID else: i = rID - if not neigh.sent[i] and not neigh.receiving[i] : + if not neigh.sent[i] and not neigh.received[i] : neigh.sent[i] = 1 neigh.node.receiveSegment(rID, cID, self.ID) self.statsTxInSlot += 1 @@ -404,7 +404,7 @@ class Validator: cID = random.randrange(0, self.shape.blockSize) if self.block.getSegment(rID, cID) : neigh = random.choice(list(self.rowNeighbors[rID].values())) - if not neigh.sent[cID] and not neigh.receiving[cID] : + if not neigh.sent[cID] and not neigh.received[cID] : neigh.sent[cID] = 1 neigh.node.receiveSegment(rID, cID, self.ID) self.statsTxInSlot += 1 @@ -416,7 +416,7 @@ class Validator: rID = random.randrange(0, self.shape.blockSize) if self.block.getSegment(rID, cID) : neigh = random.choice(list(self.columnNeighbors[cID].values())) - if not neigh.sent[rID] and not neigh.receiving[rID] : + if not neigh.sent[rID] and not neigh.received[rID] : neigh.sent[rID] = 1 neigh.node.receiveSegment(rID, cID, self.ID) self.statsTxInSlot += 1