Add KDoc documentation to Cache averaging algorithm#600
Open
gioalex07 wants to merge 1 commit intoVREMSoftwareDevelopment:mainfrom
Open
Add KDoc documentation to Cache averaging algorithm#600gioalex07 wants to merge 1 commit intoVREMSoftwareDevelopment:mainfrom
gioalex07 wants to merge 1 commit intoVREMSoftwareDevelopment:mainfrom
Conversation
Document the exponential moving average used in calculate(), the cache depth strategy in size() based on scan speed thresholds, the eviction logic in add(), and the purpose of CacheResult. No logic changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Document the exponential moving average used in calculate(), the cache depth strategy in size() based on scan speed thresholds, the eviction logic in add(), and the purpose of CacheResult. No logic changes.
Summary
Cache.ktexplaining the averaging algorithm and cache sizing strategy.What does this implement/fix?
CacheResult: documents purpose of the classscanResults(): documents the grouping and averaging behavior per unique access point (BSSID + SSID)add(): documents eviction strategy and internal count cyclesize(): documents all scan speed thresholds and their effect on cache depthcalculate(): documents the exponential moving average formula(previous + current) / 2and the signal penalty applied when screen size is unavailableDoes this close any issues?
How was this tested?
Checklist (required before marking ready)
app/src/test/) — N/A, documentation onlyAdditional context
The
calculate()method used an exponential moving average without any inline explanation,making it non-obvious why
(accumulator + element) / 2was chosen over a true N-sample average.The
size()thresholds were also implicit. This PR makes both strategies explicit for future contributors.