mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-19 04:14:28 +00:00
rector: codingStyle
This commit is contained in:
@ -113,7 +113,7 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
|
||||
|
||||
$forwardScheduleList = [];
|
||||
|
||||
for ($i = 0; $i < $totalTeamDifferences - 1; $i++) {
|
||||
for ($i = 0; $i < $totalTeamDifferences - 1; ++$i) {
|
||||
$teamPerformancesToTeamPerformanceDifferencesLayerLocalFactors = $this->TeamPerformancesToTeamPerformanceDifferencesLayer->getLocalFactors();
|
||||
$teamDifferencesComparisonLayerLocalFactors = $this->TeamDifferencesComparisonLayer->getLocalFactors();
|
||||
|
||||
@ -149,7 +149,7 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
|
||||
|
||||
$backwardScheduleList = [];
|
||||
|
||||
for ($i = 0; $i < $totalTeamDifferences - 1; $i++) {
|
||||
for ($i = 0; $i < $totalTeamDifferences - 1; ++$i) {
|
||||
$teamPerformancesToTeamPerformanceDifferencesLayerLocalFactors = $this->TeamPerformancesToTeamPerformanceDifferencesLayer->getLocalFactors();
|
||||
$teamDifferencesComparisonLayerLocalFactors = $this->TeamDifferencesComparisonLayer->getLocalFactors();
|
||||
|
||||
|
@ -37,7 +37,7 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
|
||||
|
||||
return $this->scheduleSequence(
|
||||
array_map(
|
||||
fn ($weightedSumFactor): ScheduleStep => new ScheduleStep('Perf to Team Perf Step', $weightedSumFactor, 0),
|
||||
static fn($weightedSumFactor): ScheduleStep => new ScheduleStep('Perf to Team Perf Step', $weightedSumFactor, 0),
|
||||
$localFactors
|
||||
),
|
||||
'all player perf to team perf schedule'
|
||||
@ -50,9 +50,8 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
|
||||
protected function createPlayerToTeamSumFactor(array $teamMembers, Variable $sumVariable): GaussianWeightedSumFactor
|
||||
{
|
||||
$weights = array_map(
|
||||
function ($v): float {
|
||||
static function ($v): float {
|
||||
$player = $v->getKey();
|
||||
|
||||
return PartialPlay::getPartialPlayPercentage($player);
|
||||
},
|
||||
$teamMembers
|
||||
@ -72,7 +71,7 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
|
||||
foreach ($localFactors as $currentFactor) {
|
||||
$localCurrentFactor = $currentFactor;
|
||||
$numberOfMessages = $localCurrentFactor->getNumberOfMessages();
|
||||
for ($currentIteration = 1; $currentIteration < $numberOfMessages; $currentIteration++) {
|
||||
for ($currentIteration = 1; $currentIteration < $numberOfMessages; ++$currentIteration) {
|
||||
$allFactors[] = new ScheduleStep(
|
||||
'team sum perf @' . $currentIteration,
|
||||
$localCurrentFactor,
|
||||
@ -89,7 +88,7 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
|
||||
*/
|
||||
private function createOutputVariable(array $team): Variable
|
||||
{
|
||||
$memberNames = array_map(fn ($currentPlayer): string => (string)($currentPlayer->getKey()), $team);
|
||||
$memberNames = array_map(static fn($currentPlayer): string => (string)($currentPlayer->getKey()), $team);
|
||||
|
||||
$teamMemberNames = \implode(', ', $memberNames);
|
||||
|
||||
|
@ -55,7 +55,7 @@ class PlayerPriorValuesToSkillsLayer extends TrueSkillFactorGraphLayer
|
||||
|
||||
return $this->scheduleSequence(
|
||||
array_map(
|
||||
fn ($prior): ScheduleStep => new ScheduleStep('Prior to Skill Step', $prior, 0),
|
||||
static fn($prior): ScheduleStep => new ScheduleStep('Prior to Skill Step', $prior, 0),
|
||||
$localFactors
|
||||
),
|
||||
'All priors'
|
||||
|
@ -53,7 +53,7 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
|
||||
|
||||
return $this->scheduleSequence(
|
||||
array_map(
|
||||
fn ($likelihood): ScheduleStep => new ScheduleStep('Skill to Perf step', $likelihood, 0),
|
||||
static fn($likelihood): ScheduleStep => new ScheduleStep('Skill to Perf step', $likelihood, 0),
|
||||
$localFactors
|
||||
),
|
||||
'All skill to performance sending'
|
||||
@ -66,7 +66,7 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
|
||||
|
||||
return $this->scheduleSequence(
|
||||
array_map(
|
||||
fn ($likelihood): ScheduleStep => new ScheduleStep('name', $likelihood, 1),
|
||||
static fn($likelihood): ScheduleStep => new ScheduleStep('name', $likelihood, 1),
|
||||
$localFactors
|
||||
),
|
||||
'All skill to performance sending'
|
||||
|
@ -28,7 +28,7 @@ class TeamDifferencesComparisonLayer extends TrueSkillFactorGraphLayer
|
||||
$inputVarGroups = $this->getInputVariablesGroups();
|
||||
$inputVarGroupsCount = count($inputVarGroups);
|
||||
|
||||
for ($i = 0; $i < $inputVarGroupsCount; $i++) {
|
||||
for ($i = 0; $i < $inputVarGroupsCount; ++$i) {
|
||||
$isDraw = ($this->teamRanks[$i] == $this->teamRanks[$i + 1]);
|
||||
$teamDifference = $inputVarGroups[$i][0];
|
||||
|
||||
|
@ -15,7 +15,7 @@ class TeamPerformancesToTeamPerformanceDifferencesLayer extends TrueSkillFactorG
|
||||
$inputVariablesGroupsCount = count($inputVariablesGroups);
|
||||
$outputVariablesGroup = &$this->getOutputVariablesGroups();
|
||||
|
||||
for ($i = 0; $i < $inputVariablesGroupsCount - 1; $i++) {
|
||||
for ($i = 0; $i < $inputVariablesGroupsCount - 1; ++$i) {
|
||||
$strongerTeam = $inputVariablesGroups[$i][0];
|
||||
$weakerTeam = $inputVariablesGroups[$i + 1][0];
|
||||
|
||||
|
Reference in New Issue
Block a user