Skip to content

Commit

Permalink
backend/feat: Rolling Window Stop Detection
Browse files Browse the repository at this point in the history
  • Loading branch information
khuzema786 committed Oct 16, 2024
1 parent 8439f81 commit a4fabeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ pub fn detect_stop(
);

let curr_bucket_max_points_to_consider =
(curr_bucket_weightage * config.min_points_within_radius_threshold as f64).round() as u64;
curr_bucket_weightage * config.min_points_within_radius_threshold as u64;

if let Some(stop_detection) = stop_detection {
let mut locations = filter_locations_based_on_bucket_weightage(
Expand Down
4 changes: 2 additions & 2 deletions crates/location_tracking_service/src/common/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ pub fn get_bucket_from_timestamp(bucket_expiry_in_seconds: &u64, TimeStamp(ts):
pub fn get_bucket_weightage_from_timestamp(
bucket_expiry_in_seconds: &u64,
TimeStamp(ts): TimeStamp,
) -> f64 {
ts.timestamp() as f64 % *bucket_expiry_in_seconds as f64 / *bucket_expiry_in_seconds as f64
) -> u64 {
ts.timestamp() as u64 % *bucket_expiry_in_seconds / *bucket_expiry_in_seconds
}

/// Calculates the distance between two geographical points in meters.
Expand Down

0 comments on commit a4fabeb

Please sign in to comment.