Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Added support of hrw weighted sort for netmap #23

Merged
merged 9 commits into from
May 30, 2019
Merged

Conversation

alexvanin
Copy link
Contributor

This commit proposes to add weights into bucket structure by defining
Node structure which contains node index and weight. This allows to
perform weighted hrw sort in the GetSelection routine. For this purpose
new function AddStrawNode() was added.

  • added Node structure which contains N and W fields
  • changed function to support weight distribution during graph operations
  • fixed existing tests
  • added tests for weighted operations
  • recompiled demo fixtures, so demo works correctly with new feature

alexvanin added 8 commits May 28, 2019 18:53
This commit proposes to add weights into bucket structure by defining
Node structure which contains node index and weight. This allows to
perform weighted hrw sort in the GetSelection routine. For
this purpose new function `AddStrawNode()` was added.

- added Node structure with contains `n` and `w` fields
- changed function to support weight distribution during graph
  operations
- fixed existing tests
@codecov-io
Copy link

codecov-io commented May 28, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@b279016). Click here to learn what that means.
The diff coverage is 73%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #23   +/-   ##
=========================================
  Coverage          ?   27.25%           
=========================================
  Files             ?        5           
  Lines             ?     1871           
  Branches          ?        0           
=========================================
  Hits              ?      510           
  Misses            ?     1333           
  Partials          ?       28
Impacted Files Coverage Δ
policy_dump.go 0% <0%> (ø)
utils.go 100% <100%> (ø)
policy.go 81.81% <71.08%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b279016...594f6e3. Read the comment docs.

@alexvanin
Copy link
Contributor Author

I appreciate any ideas for tests with weighted nodes.

Copy link
Contributor

@im-kulikov im-kulikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I propose to rename N() W() to normal names and add description

Copy link
Contributor

@im-kulikov im-kulikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice job

@alexvanin alexvanin merged commit 9f67971 into master May 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants