Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
c1dfed28
Commit
c1dfed28
authored
May 12, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
dfb861a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+6
-6
No files found.
wcfs/internal/xbtree.py
View file @
c1dfed28
...
...
@@ -204,16 +204,16 @@ def Restructure(ztree, newStructure):
# dict with all k->v from ztree
kv
=
dict
(
ztree
)
# walk original and new strucutres level by level.
# walk original and new structures level by level.
# XXX push buckets till the end
# for each level we have A1...An "old" nodes, and B1...Bm "new" nodes.
# XXX buckets - push till end
# if n == m - map A-B 1-to-1
# if n < m - we have to "insert" (m-n) new nodes
# if n > m - we have to "forget" (n-m) old nodes.
# The process of insert/forget is organized as follows:
# every node from B set will in the end be to a node from A set.
# every node from B set will in the end be
associated
to a node from A set.
# to make this association we:
# - compute D(Ai,Bj) where D is wighted distance
# - compute D(Ai,Bj) where D is w
e
ighted distance
# - if we need to insert, we order Bj by δA(Bj) = min_i D(Ai,Bj)
# and note Bj with max(δA(Bj)) to be associated with newly created nodes.
# - if we need to forget, we order Ai by δB(Ai) = min_j D(Ai,Bj)
...
...
@@ -235,7 +235,7 @@ def Restructure(ztree, newStructure):
zrlevelv
=
list
(
__zwalkBFS
(
ztree
))
# [] of _NodeInRange
rlevelv
=
list
(
__walkBFS
(
tnew
))
# [] of _NodeInRange
# asso
t
iate every non-bucket node in tnew to a znode
# asso
c
iate every non-bucket node in tnew to a znode
# extract bucket nodes.
zrbucketv
=
[]
# of _NodeInRange
rbucketv
=
[]
# of _NodeInRange
...
...
@@ -713,7 +713,7 @@ def graphviz(t, clustername=''):
for
(
i
,
node
)
in
enumerate
(
nodev
):
assert
isinstance
(
node
,
(
Tree
,
Bucket
))
# register node insymtab
# register node in
symtab
assert
id
(
node
)
not
in
symtab
kind
=
(
'T'
if
isinstance
(
node
,
Tree
)
else
'B'
)
symtab
[
id
(
node
)]
=
'%s%s%d:%d'
%
(
clustername
+
'_'
,
kind
,
level
,
i
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment