mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-07 15:43:08 +00:00
Remove global randomness parameter for validator
This commit is contained in:
parent
3642083f22
commit
680817b97b
@ -50,7 +50,7 @@ class Simulator:
|
|||||||
end = offset+((j+1)*self.shape.chi)
|
end = offset+((j+1)*self.shape.chi)
|
||||||
r = rows[start:end]
|
r = rows[start:end]
|
||||||
c = columns[start:end]
|
c = columns[start:end]
|
||||||
val = Validator(i, int(not i!=0), self.logger, self.shape, r, c, self.config.evenLineDistribution)
|
val = Validator(i, int(not i!=0), self.logger, self.shape, r, c)
|
||||||
else:
|
else:
|
||||||
val = Validator(i, int(not i!=0), self.logger, self.shape)
|
val = Validator(i, int(not i!=0), self.logger, self.shape)
|
||||||
if i == self.proposerID:
|
if i == self.proposerID:
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class Validator:
|
|||||||
"""It returns the validator ID."""
|
"""It returns the validator ID."""
|
||||||
return str(self.ID)
|
return str(self.ID)
|
||||||
|
|
||||||
def __init__(self, ID, amIproposer, logger, shape, rows = None, columns = None, globalRandomness = True):
|
def __init__(self, ID, amIproposer, logger, shape, rows = None, columns = None):
|
||||||
"""It initializes the validator with the logger shape and rows/columns.
|
"""It initializes the validator with the logger shape and rows/columns.
|
||||||
|
|
||||||
If rows/columns are specified these are observed, otherwise (default)
|
If rows/columns are specified these are observed, otherwise (default)
|
||||||
@ -66,13 +66,9 @@ class Validator:
|
|||||||
else:
|
else:
|
||||||
#if shape.deterministic:
|
#if shape.deterministic:
|
||||||
# random.seed(self.ID)
|
# random.seed(self.ID)
|
||||||
if globalRandomness:
|
vpn = self.shape.vpn1 if (self.ID <= shape.numberNodes * shape.class1ratio) else self.shape.vpn2
|
||||||
self.rowIDs = rows
|
self.rowIDs = rows if rows else unionOfSamples(range(self.shape.blockSize), self.shape.chi, vpn)
|
||||||
self.columnIDs = columns
|
self.columnIDs = columns if columns else unionOfSamples(range(self.shape.blockSize), self.shape.chi, vpn)
|
||||||
else:
|
|
||||||
vpn = self.shape.vpn1 if (self.ID <= shape.numberNodes * shape.class1ratio) else self.shape.vpn2
|
|
||||||
self.rowIDs = rows if rows else unionOfSamples(range(self.shape.blockSize), self.shape.chi, vpn)
|
|
||||||
self.columnIDs = columns if columns else unionOfSamples(range(self.shape.blockSize), self.shape.chi, vpn)
|
|
||||||
self.rowNeighbors = collections.defaultdict(dict)
|
self.rowNeighbors = collections.defaultdict(dict)
|
||||||
self.columnNeighbors = collections.defaultdict(dict)
|
self.columnNeighbors = collections.defaultdict(dict)
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ numJobs = 3
|
|||||||
|
|
||||||
# distribute rows/columns evenly between validators (True)
|
# distribute rows/columns evenly between validators (True)
|
||||||
# or generate it using local randomness (False)
|
# or generate it using local randomness (False)
|
||||||
evenLineDistribution = False
|
evenLineDistribution = True
|
||||||
|
|
||||||
# Number of simulation runs with the same parameters for statistical relevance
|
# Number of simulation runs with the same parameters for statistical relevance
|
||||||
runs = range(10)
|
runs = range(10)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user