@vue-skuilder/db 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1566,12 +1566,13 @@ __export(elo_exports, {
1566
1566
  default: () => ELONavigator
1567
1567
  });
1568
1568
  import { toCourseElo as toCourseElo2 } from "@vue-skuilder/common";
1569
- var ELONavigator;
1569
+ var ELO_RELEVANCE_SIGMA, ELONavigator;
1570
1570
  var init_elo = __esm({
1571
1571
  "src/core/navigators/generators/elo.ts"() {
1572
1572
  "use strict";
1573
1573
  init_navigators();
1574
1574
  init_logger();
1575
+ ELO_RELEVANCE_SIGMA = 300;
1575
1576
  ELONavigator = class extends ContentNavigator {
1576
1577
  /** Human-readable name for CardGenerator interface */
1577
1578
  name;
@@ -1611,8 +1612,8 @@ var init_elo = __esm({
1611
1612
  const scored = newCards.map((c) => {
1612
1613
  const cardElo = c.elo ?? 1e3;
1613
1614
  const distance = Math.abs(cardElo - userGlobalElo);
1614
- const rawScore = Math.max(0, 1 - distance / 500);
1615
- const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
1615
+ const relevance = Math.exp(-((distance / ELO_RELEVANCE_SIGMA) ** 2));
1616
+ const samplingKey = relevance * (0.5 + 0.5 * Math.random());
1616
1617
  return {
1617
1618
  cardId: c.cardID,
1618
1619
  courseId: c.courseID,
@@ -1624,7 +1625,7 @@ var init_elo = __esm({
1624
1625
  strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
1625
1626
  action: "generated",
1626
1627
  score: samplingKey,
1627
- reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
1628
+ reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), relevance ${relevance.toFixed(3)}, key ${samplingKey.toFixed(3)}`
1628
1629
  }
1629
1630
  ]
1630
1631
  };