mirror of
https://github.com/codex-storage/das-research.git
synced 2025-02-23 08:18:14 +00:00
Fix net degree bug
This commit is contained in:
parent
a6896a60dd
commit
d5e7ae7ea7
@ -42,7 +42,6 @@ class Simulator:
|
|||||||
self.validators.append(val)
|
self.validators.append(val)
|
||||||
|
|
||||||
def initNetwork(self):
|
def initNetwork(self):
|
||||||
self.shape.netDegree = 6
|
|
||||||
rowChannels = [[] for i in range(self.shape.blockSize)]
|
rowChannels = [[] for i in range(self.shape.blockSize)]
|
||||||
columnChannels = [[] for i in range(self.shape.blockSize)]
|
columnChannels = [[] for i in range(self.shape.blockSize)]
|
||||||
for v in self.validators:
|
for v in self.validators:
|
||||||
|
20
study.py
20
study.py
@ -26,20 +26,22 @@ def study():
|
|||||||
for nv in range(config.nvStart, config.nvStop+1, config.nvStep):
|
for nv in range(config.nvStart, config.nvStop+1, config.nvStep):
|
||||||
for blockSize in range(config.blockSizeStart, config.blockSizeStop+1, config.blockSizeStep):
|
for blockSize in range(config.blockSizeStart, config.blockSizeStop+1, config.blockSizeStep):
|
||||||
for fr in range(config.failureRateStart, config.failureRateStop+1, config.failureRateStep):
|
for fr in range(config.failureRateStart, config.failureRateStop+1, config.failureRateStep):
|
||||||
for netDegree in range(config.netDegreeStart, config.netDegreeStop, config.netDegreeStep):
|
for netDegree in range(config.netDegreeStart, config.netDegreeStop+1, config.netDegreeStep):
|
||||||
for chi in range(config.chiStart, config.chiStop+1, config.chiStep):
|
for chi in range(config.chiStart, config.chiStop+1, config.chiStep):
|
||||||
|
|
||||||
if not config.deterministic:
|
if not config.deterministic:
|
||||||
random.seed(datetime.now())
|
random.seed(datetime.now())
|
||||||
|
|
||||||
shape = Shape(blockSize, nv, fr, chi, netDegree, run)
|
# Network Degree has to be an even number
|
||||||
sim.resetShape(shape)
|
if netDegree % 2 == 0:
|
||||||
sim.initValidators()
|
shape = Shape(blockSize, nv, fr, chi, netDegree, run)
|
||||||
sim.initNetwork()
|
sim.resetShape(shape)
|
||||||
result = sim.run()
|
sim.initValidators()
|
||||||
sim.logger.info("Shape: %s ... Block Available: %d" % (str(sim.shape.__dict__), result.blockAvailable), extra=sim.format)
|
sim.initNetwork()
|
||||||
results.append(copy.deepcopy(result))
|
result = sim.run()
|
||||||
simCnt += 1
|
sim.logger.info("Shape: %s ... Block Available: %d" % (str(sim.shape.__dict__), result.blockAvailable), extra=sim.format)
|
||||||
|
results.append(copy.deepcopy(result))
|
||||||
|
simCnt += 1
|
||||||
|
|
||||||
end = time.time()
|
end = time.time()
|
||||||
sim.logger.info("A total of %d simulations ran in %d seconds" % (simCnt, end-start), extra=sim.format)
|
sim.logger.info("A total of %d simulations ran in %d seconds" % (simCnt, end-start), extra=sim.format)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user