diff --git a/src/SkillCalculator.php b/src/SkillCalculator.php index b5b7bff..e9a423d 100644 --- a/src/SkillCalculator.php +++ b/src/SkillCalculator.php @@ -44,6 +44,9 @@ abstract class SkillCalculator return (bool)($this->supportedOptions & $option) == $option; } + /** + * @param Team[] $teamsOfPlayerToRatings + */ protected function validateTeamCountAndPlayersCountPerTeam(array $teamsOfPlayerToRatings): void { self::validateTeamCountAndPlayersCountPerTeamWithRanges($teamsOfPlayerToRatings, $this->totalTeamsAllowed, $this->playersPerTeamAllowed); diff --git a/src/TrueSkill/Factors/GaussianWeightedSumFactor.php b/src/TrueSkill/Factors/GaussianWeightedSumFactor.php index 906cd20..5ae4ca7 100644 --- a/src/TrueSkill/Factors/GaussianWeightedSumFactor.php +++ b/src/TrueSkill/Factors/GaussianWeightedSumFactor.php @@ -17,8 +17,12 @@ class GaussianWeightedSumFactor extends GaussianFactor { private array $variableIndexOrdersForWeights = []; - // This following is used for convenience, for example, the first entry is [0, 1, 2] - // corresponding to v[0] = a1*v[1] + a2*v[2] + + /** + * This following is used for convenience, for example, the first entry is [0, 1, 2] + * corresponding to v[0] = a1*v[1] + a2*v[2] + * @var array $weights + */ private array $weights = []; private array $weightsSquared = []; diff --git a/src/TrueSkill/Layers/PlayerPerformancesToTeamPerformancesLayer.php b/src/TrueSkill/Layers/PlayerPerformancesToTeamPerformancesLayer.php index 0a968b5..26f0a42 100644 --- a/src/TrueSkill/Layers/PlayerPerformancesToTeamPerformancesLayer.php +++ b/src/TrueSkill/Layers/PlayerPerformancesToTeamPerformancesLayer.php @@ -5,6 +5,7 @@ namespace DNW\Skills\TrueSkill\Layers; use DNW\Skills\FactorGraphs\ScheduleStep; use DNW\Skills\FactorGraphs\ScheduleSequence; use DNW\Skills\PartialPlay; +use DNW\Skills\Player; use DNW\Skills\TrueSkill\Factors\GaussianWeightedSumFactor; use DNW\Skills\FactorGraphs\Variable; @@ -39,6 +40,9 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye ); } + /** + * @param Team[] $teamMembers + */ protected function createPlayerToTeamSumFactor(array $teamMembers, Variable $sumVariable): GaussianWeightedSumFactor { $weights = array_map( diff --git a/src/TrueSkill/Layers/PlayerPriorValuesToSkillsLayer.php b/src/TrueSkill/Layers/PlayerPriorValuesToSkillsLayer.php index bb8e781..55fa357 100644 --- a/src/TrueSkill/Layers/PlayerPriorValuesToSkillsLayer.php +++ b/src/TrueSkill/Layers/PlayerPriorValuesToSkillsLayer.php @@ -7,6 +7,7 @@ use DNW\Skills\FactorGraphs\Variable; use DNW\Skills\FactorGraphs\KeyedVariable; use DNW\Skills\Numerics\BasicMath; use DNW\Skills\Rating; +use DNW\Skills\Team; use DNW\Skills\TrueSkill\Factors\GaussianPriorFactor; use DNW\Skills\TrueSkill\TrueSkillFactorGraph; use DNW\Skills\FactorGraphs\ScheduleSequence; @@ -15,6 +16,9 @@ use DNW\Skills\FactorGraphs\ScheduleSequence; // start the process. class PlayerPriorValuesToSkillsLayer extends TrueSkillFactorGraphLayer { + /** + * @param Team[] $teams + */ public function __construct(TrueSkillFactorGraph $parentGraph, private readonly array $teams) { parent::__construct($parentGraph); diff --git a/src/TrueSkill/Layers/TeamDifferencesComparisonLayer.php b/src/TrueSkill/Layers/TeamDifferencesComparisonLayer.php index 3774843..2c824e5 100644 --- a/src/TrueSkill/Layers/TeamDifferencesComparisonLayer.php +++ b/src/TrueSkill/Layers/TeamDifferencesComparisonLayer.php @@ -11,6 +11,9 @@ class TeamDifferencesComparisonLayer extends TrueSkillFactorGraphLayer { private float $epsilon; + /** + * @param int[] $teamRanks + */ public function __construct(TrueSkillFactorGraph $parentGraph, private readonly array $teamRanks) { parent::__construct($parentGraph); diff --git a/src/TrueSkill/TrueSkillFactorGraph.php b/src/TrueSkill/TrueSkillFactorGraph.php index 8bc4675..c10179c 100644 --- a/src/TrueSkill/TrueSkillFactorGraph.php +++ b/src/TrueSkill/TrueSkillFactorGraph.php @@ -9,6 +9,7 @@ use DNW\Skills\FactorGraphs\VariableFactory; use DNW\Skills\GameInfo; use DNW\Skills\Numerics\GaussianDistribution; use DNW\Skills\Rating; +use DNW\Skills\Team; use DNW\Skills\RatingContainer; use DNW\Skills\FactorGraphs\FactorGraphLayer; use DNW\Skills\TrueSkill\Layers\IteratedTeamDifferencesInnerLayer; @@ -28,9 +29,9 @@ class TrueSkillFactorGraph extends FactorGraph private PlayerPriorValuesToSkillsLayer $priorLayer; /** - * @param GameInfo $gameInfo Parameters for the game. - * @param Team[] $teamsOfPlayerToRatings A mapping of team players and their ratings. - * @param int[] $teamRanks The ranks of the teams where 1 is first place. For a tie, repeat the number (e.g. 1, 2, 2). + * @param GameInfo $gameInfo Parameters for the game. + * @param Team[] $teams A mapping of team players and their ratings. + * @param int[] $teamRanks The ranks of the teams where 1 is first place. For a tie, repeat the number (e.g. 1, 2, 2). */ public function __construct(private readonly GameInfo $gameInfo, array $teams, array $teamRanks) {