mirror of
https://github.com/codex-storage/das-research.git
synced 2025-02-23 08:18:14 +00:00
Merge pull request #35 from status-im/issue-29
Solving Issue 29 partially. Still remains the problems of stop condition.
This commit is contained in:
commit
1b4a225114
@ -47,8 +47,9 @@ class Simulator:
|
|||||||
lightVal = int(self.shape.numberNodes * self.shape.class1ratio * self.shape.vpn1)
|
lightVal = int(self.shape.numberNodes * self.shape.class1ratio * self.shape.vpn1)
|
||||||
heavyVal = int(self.shape.numberNodes * (1-self.shape.class1ratio) * self.shape.vpn2)
|
heavyVal = int(self.shape.numberNodes * (1-self.shape.class1ratio) * self.shape.vpn2)
|
||||||
totalValidators = lightVal + heavyVal
|
totalValidators = lightVal + heavyVal
|
||||||
rows = list(range(self.shape.blockSize)) * (int(totalValidators/self.shape.blockSize)+1)
|
totalRows = totalValidators * self.shape.chi
|
||||||
columns = list(range(self.shape.blockSize)) * (int(totalValidators/self.shape.blockSize)+1)
|
rows = list(range(self.shape.blockSize)) * (int(totalRows/self.shape.blockSize)+1)
|
||||||
|
columns = list(range(self.shape.blockSize)) * (int(totalRows/self.shape.blockSize)+1)
|
||||||
offset = heavyVal*self.shape.chi
|
offset = heavyVal*self.shape.chi
|
||||||
random.shuffle(rows)
|
random.shuffle(rows)
|
||||||
random.shuffle(columns)
|
random.shuffle(columns)
|
||||||
@ -61,8 +62,8 @@ class Simulator:
|
|||||||
j = i - int(heavyVal/self.shape.vpn2)
|
j = i - int(heavyVal/self.shape.vpn2)
|
||||||
start = offset+( j *self.shape.chi)
|
start = offset+( j *self.shape.chi)
|
||||||
end = offset+((j+1)*self.shape.chi)
|
end = offset+((j+1)*self.shape.chi)
|
||||||
r = rows[start:end]
|
r = set(rows[start:end])
|
||||||
c = columns[start:end]
|
c = set(columns[start:end])
|
||||||
val = Validator(i, int(not i!=0), self.logger, self.shape, r, c)
|
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user