From 72d48b0c2e1458350f6aef16f7cf5d7471e3d071 Mon Sep 17 00:00:00 2001 From: Adam Wisher <37659188+mrwish7@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:58:25 +0100 Subject: [PATCH] Fix algorithm choice and change Es mode distance Fix hard-coded algorithm weighting values back to config values and increase distance for Es weighting to be applied --- server/tx_search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/tx_search.js b/server/tx_search.js index 2958ba5..b79c766 100644 --- a/server/tx_search.js +++ b/server/tx_search.js @@ -209,11 +209,11 @@ function validPsCompare(rdsPs, stationPs) { function evaluateStation(station) { let esMode = checkEs(); let weightDistance = station.distanceKm; - if (esMode && station.distanceKm > 500) { + if (esMode && station.distanceKm > 700) { weightDistance = Math.abs(station.distanceKm - 1500) + 200; } let erp = station.erp && station.erp > 0 ? station.erp : 1; - let extraWeight = erp > 30 && station.distanceKm <= 500 ? 0.3 : 0; + let extraWeight = erp > weightedErp && station.distanceKm <= weightDistance ? 0.3 : 0; let score = 0; // If ERP is 1W, use a simpler formula to avoid zero-scoring. if (erp === 0.001) {