@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.
@@ -1689,12 +1689,13 @@ __export(elo_exports, {
1689
1689
  default: () => ELONavigator
1690
1690
  });
1691
1691
  import { toCourseElo as toCourseElo2 } from "@vue-skuilder/common";
1692
- var ELONavigator;
1692
+ var ELO_RELEVANCE_SIGMA, ELONavigator;
1693
1693
  var init_elo = __esm({
1694
1694
  "src/core/navigators/generators/elo.ts"() {
1695
1695
  "use strict";
1696
1696
  init_navigators();
1697
1697
  init_logger();
1698
+ ELO_RELEVANCE_SIGMA = 300;
1698
1699
  ELONavigator = class extends ContentNavigator {
1699
1700
  /** Human-readable name for CardGenerator interface */
1700
1701
  name;
@@ -1734,8 +1735,8 @@ var init_elo = __esm({
1734
1735
  const scored = newCards.map((c) => {
1735
1736
  const cardElo = c.elo ?? 1e3;
1736
1737
  const distance = Math.abs(cardElo - userGlobalElo);
1737
- const rawScore = Math.max(0, 1 - distance / 500);
1738
- const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
1738
+ const relevance = Math.exp(-((distance / ELO_RELEVANCE_SIGMA) ** 2));
1739
+ const samplingKey = relevance * (0.5 + 0.5 * Math.random());
1739
1740
  return {
1740
1741
  cardId: c.cardID,
1741
1742
  courseId: c.courseID,
@@ -1747,7 +1748,7 @@ var init_elo = __esm({
1747
1748
  strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
1748
1749
  action: "generated",
1749
1750
  score: samplingKey,
1750
- reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
1751
+ reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), relevance ${relevance.toFixed(3)}, key ${samplingKey.toFixed(3)}`
1751
1752
  }
1752
1753
  ]
1753
1754
  };