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 <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2023-02-15 14:19:21 +01:00
parent af72e58d08
commit 655f3a6642
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E

View File

@ -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