mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-02 13:13:09 +00:00
Bug fixes
This commit is contained in:
parent
54ade6f429
commit
44c8dfaa7c
@ -37,10 +37,10 @@ def getNodeCountPerColumn(config):
|
||||
colsSelected = random.sample(list(range(1, numberOfCols + 1)), chiC1 if _ < node1Count else chiC2)
|
||||
for col in colsSelected:
|
||||
if col in nodeCountPerColumn.keys():
|
||||
nodeCountPerColumn[col][0 if _ < numOfNodes else 1] += 1
|
||||
nodeCountPerColumn[col][0 if _ < node1Count else 1] += 1
|
||||
else:
|
||||
nodeCountPerColumn[col] = [0, 0]
|
||||
nodeCountPerColumn[col][0 if _ < numOfNodes else 1] = 1
|
||||
nodeCountPerColumn[col][0 if _ < node1Count else 1] = 1
|
||||
|
||||
return nodeCountPerColumn
|
||||
|
||||
|
||||
@ -20,11 +20,11 @@ def plotData(conf):
|
||||
plt.clf()
|
||||
|
||||
def isGroupRecoverable(group, nodes, chi1, chi2, size, sizeK):
|
||||
uniqueLines = set()
|
||||
linesSelected = []
|
||||
for g in group:
|
||||
linesSelected = set(random.sample(list(range(1, size + 1)), chi1 if g < nodes[0] else chi2))
|
||||
uniqueLines.union(linesSelected)
|
||||
return len(uniqueLines) >= sizeK
|
||||
linesSelected += list(random.sample(list(range(1, size + 1)), chi1 if g < nodes[0] else chi2))
|
||||
uniqueLines = set(linesSelected)
|
||||
return len(uniqueLines) >= sizeK, len(uniqueLines)
|
||||
|
||||
def isGConnected(deg, nodes, mal, config):
|
||||
G = nx.random_regular_graph(deg, sum(nodes))
|
||||
@ -54,10 +54,10 @@ def getNodeCountPerColumn(config, numOfNodes):
|
||||
colsSelected = random.sample(list(range(1, numberOfCols + 1)), chiC1 if _ < node1Count else chiC2)
|
||||
for col in colsSelected:
|
||||
if col in nodeCountPerColumn.keys():
|
||||
nodeCountPerColumn[col][0 if _ < numOfNodes else 1] += 1
|
||||
nodeCountPerColumn[col][0 if _ < node1Count else 1] += 1
|
||||
else:
|
||||
nodeCountPerColumn[col] = [0, 0]
|
||||
nodeCountPerColumn[col][0 if _ < numOfNodes else 1] = 1
|
||||
nodeCountPerColumn[col][0 if _ < node1Count else 1] = 1
|
||||
|
||||
return nodeCountPerColumn
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user