Closed maplant closed 1 month ago
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:?}");
}
}
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
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 theCoverageMap
data structure which does. Additionally, you can create a "submap" from aCoverageMapBuilder
and a collection ofCoverageObject
s, which allows for inserting ranking only those hexes which are relevant to the set ofCoverageObject
s 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:
submap
method.