Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

balance: Internally represent weights as integers #282

Closed
wants to merge 3 commits into from
Closed

Commits on May 10, 2019

  1. balance: Internally represent weights as integers

    The balancer's `Weight` type represents a weight value as a float
    because, conceptually, we want to think of a unit weight of 1.0...
    
    However, storing a float means that this type cannot be hashed, and
    therefore all types that hold a Weight cannot implement Hash. Given that
    `Balance` expects that keys impl `Hash` and `Eq`, this is especially
    cumbersome.
    
    This branch changes the internal representation of weights to be
    unsigned integers with a unit value of `10_000` (corresponding to
    1.0000).
    olix0r committed May 10, 2019
    Configuration menu
    Copy the full SHA
    d66dee5 View commit details
    Browse the repository at this point in the history
  2. add autoimpls to Weighted

    olix0r committed May 10, 2019
    Configuration menu
    Copy the full SHA
    f8b150b View commit details
    Browse the repository at this point in the history
  3. add debug logging

    olix0r committed May 10, 2019
    Configuration menu
    Copy the full SHA
    1df2fee View commit details
    Browse the repository at this point in the history