Combine the candidate score parts into the final ranking score.
(candidate: &CandidateScore, recency: f64)
| 624 | |
| 625 | /// Combine the candidate score parts into the final ranking score. |
| 626 | fn final_score(candidate: &CandidateScore, recency: f64) -> f64 { |
| 627 | let neighbor = if candidate.neighbor { |
| 628 | NEIGHBOR_BONUS |
| 629 | } else { |
| 630 | 0.0 |
| 631 | }; |
| 632 | candidate.base + neighbor + RECENCY_WEIGHT * recency |
| 633 | } |
| 634 | |
| 635 | fn why_matched(candidate: &CandidateScore) -> &'static str { |
| 636 | match (candidate.base > 0.0, candidate.neighbor) { |
no outgoing calls