Update: 2026-07-06 18:23:46
This commit is contained in:
@@ -183,12 +183,25 @@ async function processCompetitor(
|
||||
countryCode: row.country_code,
|
||||
}));
|
||||
|
||||
// Known receipts for formula validation.
|
||||
// Add real receipts here as they are collected — the engine will print
|
||||
// predicted vs actual with % error so you can judge formula quality at a glance.
|
||||
const knownReceipts = comp.competitor_name === 'com.taxif.passenger' ? [
|
||||
{
|
||||
label: 'TaxiF receipt 2026-06-11 (Amman)',
|
||||
distanceKm: 2.17,
|
||||
durationMin: 6 + 38 / 60, // 6 min 38 sec
|
||||
actualPrice: 1.15, // 1.18 JOD total − 0.03 BookingFee
|
||||
},
|
||||
] : [];
|
||||
|
||||
const report = await runAnalysis(samples, {
|
||||
competitorName: comp.competitor_name,
|
||||
countryCode: comp.country_code,
|
||||
cleanOutliers: true,
|
||||
countryCode: comp.country_code,
|
||||
cleanOutliers: true,
|
||||
// surgeThresholdFraction defaults to 0.05 (5% of median price) — currency-agnostic
|
||||
tierCount: 3,
|
||||
tierCount: 3,
|
||||
knownReceipts,
|
||||
});
|
||||
|
||||
// --- Compute peak hours once, reuse in both formulas and surge insights ---
|
||||
|
||||
Reference in New Issue
Block a user