unknown coverage rebroadcast probability

This commit is contained in:
medentem 2025-01-07 15:53:55 -06:00
parent 7b4f5fa418
commit 25a58003c7
2 changed files with 7 additions and 3 deletions

View File

@ -168,12 +168,15 @@ float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming
return 1.0f;
#endif
// If we are a router or repeater, always forward because it's assumed these are in the most advantageous locations
// or if we haven't heard from any other nodes directly within the stale coverage time, fall back to always forward
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ||
config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER ||
nodeDB->secondsSinceLastDirectNeighborHeard() >= STALE_COVERAGE_SECONDS) {
config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
return 1.0f;
}
// If we haven't heard from any other nodes directly within the stale coverage time, fall back to always forward
if (nodeDB->secondsSinceLastDirectNeighborHeard() >= STALE_COVERAGE_SECONDS){
return UNKNOWN_COVERAGE_FORWARD_PROB;
}
// Retrieve recent direct neighbors within the time window
std::vector<NodeNum> recentNeighbors = nodeDB->getCoveredNodes(RECENCY_THRESHOLD_MINUTES * 60);

View File

@ -62,6 +62,7 @@ enum RxSource {
// 0.2 could be suitable because the worst case False Positive Rate of the
// coverage filter is 37%. That's if its saturated with 60 unique nodes.
#define BASE_FORWARD_PROB 0.0f
#define UNKNOWN_COVERAGE_FORWARD_PROB 0.8f
// Coverage scaling factor
#define COVERAGE_SCALE_FACTOR 4.0f