LCOV - code coverage report
Current view: top level - Source - skill.hpp (source / functions) Coverage Total Hit
Test: coverage Lines: 66.7 % 6 4
Test Date: 2026-03-02 16:42:41 Functions: - 0 0

            Line data    Source code
       1              : #pragma once
       2              : 
       3              : #include "definition.hpp"
       4              : #include "dynamicConfig.hpp"
       5              : #include "score.hpp"
       6              : 
       7              : // from Stockfish implementation
       8              : namespace Skill {
       9              : [[nodiscard]] FORCE_FINLINE unsigned int convertElo2Level() {
      10              :    const double a = 2.1586e-7;
      11              :    const double b = -0.001097;
      12              :    const double c = 2.79303;
      13              :    const double d = -978.848;
      14           20 :    const int intcorrectedElo = static_cast<int>(a * pow(DynamicConfig::strength,3) + b * pow(DynamicConfig::strength,2) + c * DynamicConfig::strength + d);
      15           40 :    return std::max(0, (intcorrectedElo - 500) / 29 - 10);
      16              : } ///@todo to be tuned
      17            0 : [[nodiscard]] FORCE_FINLINE unsigned int convertLevel2Elo() { return 29 * (DynamicConfig::level + 10) + 500; }                 ///@todo to be tuned
      18          850 : [[nodiscard]] FORCE_FINLINE bool         enabled() { return DynamicConfig::level > 0 && DynamicConfig::level < 100; }          // 0 is random mover !
      19              : [[nodiscard]] FORCE_FINLINE DepthType    limitedDepth() {
      20           20 :    return DepthType(1 + 2 * std::sqrt(std::max(0, static_cast<int>(DynamicConfig::level - 20))));
      21              : } ///@todo to be tuned
      22            0 : [[nodiscard]] FORCE_FINLINE uint64_t limitedNodes() { return static_cast<uint64_t>(std::exp((convertLevel2Elo() + 840.) / 240.)); } ///@todo to be tuned
      23              : [[nodiscard]] Move pick(std::vector<MultiPVScores>& multiPVMoves);
      24              : } // namespace Skill
        

Generated by: LCOV version 2.0-1