mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-05 19:19:18 +00:00
fixed baseline probability
This commit is contained in:
parent
74c0be6c70
commit
4d4dec1b5f
@ -214,10 +214,10 @@ float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming
|
|||||||
coverageRatio = uncoveredWeight / totalWeight;
|
coverageRatio = uncoveredWeight / totalWeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
float forwardProb = BASE_FORWARD_PROB + (coverageRatio * COVERAGE_SCALE_FACTOR);
|
float forwardProb = (coverageRatio * COVERAGE_SCALE_FACTOR);
|
||||||
|
|
||||||
// Clamp probability between 0 and 1
|
// Clamp probability between BASE_FORWARD_PROB and 1
|
||||||
forwardProb = std::min(std::max(forwardProb, 0.0f), 1.0f);
|
forwardProb = std::min(std::max(forwardProb, BASE_FORWARD_PROB), 1.0f);
|
||||||
|
|
||||||
LOG_DEBUG("CoverageRatio=%.2f, ForwardProb=%.2f (Uncovered=%d, Total=%zu)", coverageRatio, forwardProb, uncovered, neighbors);
|
LOG_DEBUG("CoverageRatio=%.2f, ForwardProb=%.2f (Uncovered=%d, Total=%zu)", coverageRatio, forwardProb, uncovered, neighbors);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user