mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-08 08:03:10 +00:00
simplify dumbRandomScheduler code
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
f95a393068
commit
82ee2b5189
@ -61,13 +61,6 @@ def sampleLine(line, limit):
|
||||
limit -= 1
|
||||
return r
|
||||
|
||||
class NextToSend:
|
||||
def __init__(self, neigh, toSend, id, dim):
|
||||
self.neigh = neigh
|
||||
self.toSend = toSend
|
||||
self.id = id
|
||||
self.dim = dim
|
||||
|
||||
class SegmentToSend:
|
||||
def __init__(self, dim, id, i):
|
||||
self.dim = dim
|
||||
@ -387,10 +380,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.received[cID] :
|
||||
neigh.sent[cID] = 1
|
||||
neigh.node.receiveSegment(rID, cID, self.ID)
|
||||
self.statsTxInSlot += 1
|
||||
if self.sendSegmentToNeigh(rID, cID, neigh):
|
||||
t = tries
|
||||
if self.statsTxInSlot >= self.bwUplink:
|
||||
return
|
||||
@ -399,10 +389,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.received[rID] :
|
||||
neigh.sent[rID] = 1
|
||||
neigh.node.receiveSegment(rID, cID, self.ID)
|
||||
self.statsTxInSlot += 1
|
||||
if self.sendSegmentToNeigh(rID, cID, neigh):
|
||||
t = tries
|
||||
t -= 1
|
||||
if self.statsTxInSlot >= self.bwUplink:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user