use itertools

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2023-03-06 22:46:17 +01:00
parent dc7a4d3c03
commit 49b1c239d7
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
1 changed files with 7 additions and 11 deletions

View File

@ -14,6 +14,7 @@ if needed.
""" """
import logging import logging
import itertools
from DAS.shape import Shape from DAS.shape import Shape
dumpXML = 1 dumpXML = 1
@ -57,14 +58,9 @@ deterministic = False
randomSeed = "DAS" randomSeed = "DAS"
def nextShape(): def nextShape():
for run in runs: for run, fr, chi, blockSize, nv, netDegree, bwUplink in itertools.product(
for fr in failureRates: runs, failureRates, chis, blockSizes, numberValidators, netDegrees, bwUplinks):
for chi in chis: # Network Degree has to be an even number
for blockSize in blockSizes: if netDegree % 2 == 0:
for nv in numberValidators: shape = Shape(blockSize, nv, fr, chi, netDegree, bwUplink, run)
for netDegree in netDegrees: yield shape
for bwUplink in bwUplinks:
# Network Degree has to be an even number
if netDegree % 2 == 0:
shape = Shape(blockSize, nv, fr, chi, netDegree, bwUplink, run)
yield shape