AnayShukla commited on
Commit
4bf65e0
·
1 Parent(s): c1d4bfd
frontend/src/components/Solver.jsx CHANGED
@@ -481,12 +481,19 @@ export default function Solver() {
481
  if (!p.isBlank) {
482
  if (chip === "bb") {
483
  total += (Number(p[`${activeGW}_Pts`]) || 0);
484
- } else if (p.Pos === "G") {
485
- total += (Number(p[`${activeGW}_Pts`]) || 0) * 0.04;
486
  } else {
487
- const bw = [0.17, 0.05, 0.02][ofIdx] || 0.02;
488
- total += (Number(p[`${activeGW}_Pts`]) || 0) * bw;
489
- ofIdx++;
 
 
 
 
 
 
 
 
 
490
  }
491
  }
492
  });
@@ -526,12 +533,19 @@ export default function Solver() {
526
  if (!p.isBlank) {
527
  if (gwChip === "bb") {
528
  gwPts += (Number(p[`${gw}_Pts`]) || 0);
529
- } else if (p.Pos === "G") {
530
- gwPts += (Number(p[`${gw}_Pts`]) || 0) * 0.04;
531
  } else {
532
- const bw = [0.17, 0.05, 0.02][ofIdx] || 0.02;
533
- gwPts += (Number(p[`${gw}_Pts`]) || 0) * bw;
534
- ofIdx++;
 
 
 
 
 
 
 
 
 
535
  }
536
  }
537
  });
@@ -1718,6 +1732,7 @@ export default function Solver() {
1718
  appliedPlanSummary={appliedPlanSummary}
1719
  setAppliedPlanSummary={setAppliedPlanSummary}
1720
  baselineEv={horizonEV}
 
1721
  />
1722
  </div>
1723
 
 
481
  if (!p.isBlank) {
482
  if (chip === "bb") {
483
  total += (Number(p[`${activeGW}_Pts`]) || 0);
 
 
484
  } else {
485
+ // THE FIX: Read dynamically from the UI settings!
486
+ const rawBw = comprehensiveSettings?.bench_weights || { 0: 0.03, 1: 0.21, 2: 0.06, 3: 0.002 };
487
+ const gkWeight = Number(rawBw[0] || 0.03);
488
+ const outWeights = [Number(rawBw[1] || 0.21), Number(rawBw[2] || 0.06), Number(rawBw[3] || 0.002)];
489
+
490
+ if (p.Pos === "G") {
491
+ total += (Number(p[`${activeGW}_Pts`]) || 0) * gkWeight;
492
+ } else {
493
+ const bw = outWeights[ofIdx] || 0.02;
494
+ total += (Number(p[`${activeGW}_Pts`]) || 0) * bw;
495
+ ofIdx++;
496
+ }
497
  }
498
  }
499
  });
 
533
  if (!p.isBlank) {
534
  if (gwChip === "bb") {
535
  gwPts += (Number(p[`${gw}_Pts`]) || 0);
 
 
536
  } else {
537
+ // THE FIX: Dynamic settings for horizon EV too!
538
+ const rawBw = comprehensiveSettings?.bench_weights || { 0: 0.03, 1: 0.21, 2: 0.06, 3: 0.002 };
539
+ const gkWeight = Number(rawBw[0] || 0.03);
540
+ const outWeights = [Number(rawBw[1] || 0.21), Number(rawBw[2] || 0.06), Number(rawBw[3] || 0.002)];
541
+
542
+ if (p.Pos === "G") {
543
+ gwPts += (Number(p[`${gw}_Pts`]) || 0) * gkWeight;
544
+ } else {
545
+ const bw = outWeights[ofIdx] || 0.02;
546
+ gwPts += (Number(p[`${gw}_Pts`]) || 0) * bw;
547
+ ofIdx++;
548
+ }
549
  }
550
  }
551
  });
 
1732
  appliedPlanSummary={appliedPlanSummary}
1733
  setAppliedPlanSummary={setAppliedPlanSummary}
1734
  baselineEv={horizonEV}
1735
+ comprehensiveSettings={comprehensiveSettings}
1736
  />
1737
  </div>
1738
 
frontend/src/components/SolverOutputPanel.jsx CHANGED
@@ -3,7 +3,7 @@ import { Zap, ExternalLink } from "lucide-react";
3
  import { CHIP_CONFIG } from "../utils/fplLogic";
4
 
5
  export const SolverOutputPanel = ({
6
- pendingSolutions, setPendingSolutions, isSolving, globalPlayers, applySolution, appliedPlanSummary, setAppliedPlanSummary, baselineEv = 0
7
  }) => {
8
 
9
  // BULLETPROOF RELATIVE EV
@@ -52,11 +52,18 @@ export const SolverOutputPanel = ({
52
  const pts = Number(p[`${gw}_Pts`]) || 0;
53
  if (gwChip === "bb") {
54
  gwPts += pts;
55
- } else if (p.Pos === "G") {
56
- gwPts += pts * 0.04;
57
  } else {
58
- gwPts += pts * ([0.17, 0.05, 0.02][ofIdx] || 0.02);
59
- ofIdx++;
 
 
 
 
 
 
 
 
 
60
  }
61
  }
62
  });
 
3
  import { CHIP_CONFIG } from "../utils/fplLogic";
4
 
5
  export const SolverOutputPanel = ({
6
+ pendingSolutions, setPendingSolutions, isSolving, globalPlayers, applySolution, appliedPlanSummary, setAppliedPlanSummary, baselineEv = 0,comprehensiveSettings
7
  }) => {
8
 
9
  // BULLETPROOF RELATIVE EV
 
52
  const pts = Number(p[`${gw}_Pts`]) || 0;
53
  if (gwChip === "bb") {
54
  gwPts += pts;
 
 
55
  } else {
56
+ // THE FIX: Output Panel now perfectly matches Python and the main UI!
57
+ const rawBw = comprehensiveSettings?.bench_weights || { 0: 0.03, 1: 0.21, 2: 0.06, 3: 0.002 };
58
+ const gkWeight = Number(rawBw[0] || 0.03);
59
+ const outWeights = [Number(rawBw[1] || 0.21), Number(rawBw[2] || 0.06), Number(rawBw[3] || 0.002)];
60
+
61
+ if (p.Pos === "G") {
62
+ gwPts += pts * gkWeight;
63
+ } else {
64
+ gwPts += pts * (outWeights[ofIdx] || 0.02);
65
+ ofIdx++;
66
+ }
67
  }
68
  }
69
  });