Commit Graph
18 Commits
Author SHA1 Message Date
swaits 880d604d87 chore: bump crate versionSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-07 21:44:47 -07:00
swaits 8f95ed8c9f test: add test for NetworkCoordinate::estimate_rtt
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 21:43:35 -07:00
swaits 81ffc119e5 style: formattingSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-07 21:37:29 -07:00
swaits e86e211bed test: add property tests to HeightVector
Which also helped me fix a bug (using is_sign_negative() when we actually are okay with -0.0).

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 21:37:21 -07:00
swaits e9c91e1e11 feat: add PlanetLab example
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 20:40:06 -07:00
swaits 26a7b243dc fix: add numeric stability
Made `HeightVector` numerically safe; while `Vector` remains numerically unsafe (i.e. it can divide by 0, NaN, Inf, etc).

When HeightVector runs into a problem, it just re-randomizes itself. Since the algorithm converges relatively quickly, this seems to work fine.

Also fixed a bug so that now height will always start as a positive number (and stay that way, else get re-randomized).

Added safety to `NetworkCoordinate` which now checks that its error didn’t pull a `HeightVector` into a negative height; in which case it also re-randomizes.

Clarified the `random` construction, tweaked the DEFAULT_ERROR constant, and updated tests accordingly.

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 20:25:10 -07:00
swaits 441f83cc6f test: add proptest, make vec mul/div scalar safer
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 16:29:01 -07:00
swaits 57dcb9dd7f docs: add link to ticket trackerSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 10:48:28 -07:00
swaits 579035cd2d docs: add link to docs.rs in READMESigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 10:43:36 -07:00
swaits 308f94d0d1 chore: bump crate versionSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 10:40:57 -07:00
swaits 3347e5fe0d docs: clean up export, add module level docs- public NetworkCoordinate so it’s easer to just use vivaldi_nc::NetworkCoordinate- add module level docs and examples in lib.rs- cleanup READMESigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 10:39:59 -07:00
swaits ebfee50ee6 chore: update README, bump crate versionSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-04 09:48:01 -07:00
swaits b3147dfad7 feat: add serde
Adds serialization/deserialization support via serde and serde_with.

Also:

- remove `license-file` in Cargo.toml (superfluous)
- update README with Getting Started section
- add `serde` and `serde_with` dependencies to README
- add tests to `HeightVector`
- tweak assertion in `NetworkCoordinate`
- refactor `Vector` to be a struct witn an `inner` instead of a tuple struct so that we can use `serde_as` (from `serde_with`) to help us derive SerDe implementations for the const generic sized array
- moved trait requirements (which are getting long) into where clauses

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-04 09:42:46 -07:00
swaits 9265b5fa28 chore: remove Cargo.lock and add to .gitignoreBecause this is a library, Cargo.lock should not be committed.Signed-off-by: Stephen Waits <steve@waits.net> 2023-02-04 09:37:40 -07:00
swaits dd063825f9 chore: prep Cargo.toml for publication, add badgesSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-02 22:33:15 -07:00
swaits c2f2d874e4 chore: add build badge to readmeSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-02 21:56:18 -07:00
swaits 280f50e9f7 chore: Add build script for git.sr.htSigned-off-by: Stephen Waits <steve@waits.net> 2023-02-02 21:48:35 -07:00
swaits f29deb5335 initial commit
Includes an initial implementation, some tests, and some documentation.

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-02 21:19:09 -07:00