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

Add coverage_map crate to provide CoverageMapBuilder and CoverageMap data structures #819

Merged
merged 13 commits into from
Jun 5, 2024

Conversation

maplant
Copy link
Contributor

@maplant maplant commented May 30, 2024

What does this new crate provide?

  • CoverageMapBuilder: A data structure for keeping track of the current rank of all of the radios providing coverage to a given set of hexes. This data structure does not allow you to map radios to their ranked hex coverage, but allows you to build the CoverageMap data structure which does. Additionally, you can create a "submap" from a CoverageMapBuilder and a collection of CoverageObjects, which allows for inserting ranking only those hexes which are relevant to the set of CoverageObjects provided.
  • CoverageMap: A data structure that maps hotspots to all of their ranked hex coverage.

What work is left to do in this crate?

This crate is basically complete, but the following work remains:

  • Port over the old coverage tests from the mobile verifier.
  • Add new tests for the submap method.

@maplant maplant changed the title DRAFT: Add coverage_map crate to provide CoverageMapBuilder and CoverageMap data structures Add coverage_map crate to provide CoverageMapBuilder and CoverageMap data structures May 31, 2024
@michaeldjeffrey
Copy link
Contributor

When there's a single radio covering 2 hexes, both hexes should come back with rank 1.
Currently, they are ranked sequentially.

#[test]
    fn single_radio() {
        let mut indoor_coverage = IndoorCellTree::default();

        insert_indoor_coverage_object(
            &mut indoor_coverage,
            indoor_cbrs_coverage_with_loc(
                "1",
                Cell::from_raw(0x8c2681a3064d9ff).unwrap(),
                date(2022, 2, 2),
            ),
        );
        insert_indoor_coverage_object(
            &mut indoor_coverage,
            indoor_cbrs_coverage_with_loc(
                "1",
                Cell::from_raw(0x8c2681a3064dbff).unwrap(),
                date(2022, 2, 2),
            ),
        );

        let coverage = into_indoor_coverage_map(indoor_coverage, &NoBoostedHexes, Utc::now())
            .collect::<Vec<_>>();
        for ranked in coverage {
            println!("{ranked:?}");
        }
    }

@maplant
Copy link
Contributor Author

maplant commented Jun 4, 2024

When there's a single radio covering 2 hexes, both hexes should come back with rank 1. Currently, they are ranked sequentially.

#[test]
    fn single_radio() {
        let mut indoor_coverage = IndoorCellTree::default();

        insert_indoor_coverage_object(
            &mut indoor_coverage,
            indoor_cbrs_coverage_with_loc(
                "1",
                Cell::from_raw(0x8c2681a3064d9ff).unwrap(),
                date(2022, 2, 2),
            ),
        );
        insert_indoor_coverage_object(
            &mut indoor_coverage,
            indoor_cbrs_coverage_with_loc(
                "1",
                Cell::from_raw(0x8c2681a3064dbff).unwrap(),
                date(2022, 2, 2),
            ),
        );

        let coverage = into_indoor_coverage_map(indoor_coverage, &NoBoostedHexes, Utc::now())
            .collect::<Vec<_>>();
        for ranked in coverage {
            println!("{ranked:?}");
        }
    }

Fixed and added as test

@maplant maplant merged commit 6420804 into main Jun 5, 2024
15 checks passed
@maplant maplant deleted the map/coverage-map branch June 5, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants