Commit 0faa50e4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 7112634b
...@@ -249,10 +249,14 @@ def Restructure(ztree, newStructure): ...@@ -249,10 +249,14 @@ def Restructure(ztree, newStructure):
assert not hasattr(rn.node, 'Z') assert not hasattr(rn.node, 'Z')
rn.node.Z = None rn.node.Z = None
def D(a, b):
return abs(a.range.klo - b.range.klo) + \
abs(a.range.khi - b.range.khi)
# prepare cost matrix # prepare cost matrix
C = np.zeros((len(RNv), len(RZv))) C = np.zeros((len(RNv), len(RZv)))
for j in range(RNv): # "workers" for j in range(len(RNv)): # "workers"
for i in range(RZv): # "jobs" for i in range(len(RZv)): # "jobs"
C[j,i] = D(RZv[i], RNv[j]) C[j,i] = D(RZv[i], RNv[j])
# find the assignments. # find the assignments.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment