Less Stringable
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Jens True 2024-03-19 16:24:19 +00:00
parent 796bd993d0
commit 063a64a4f6
6 changed files with 17 additions and 16 deletions

@ -77,7 +77,7 @@ abstract class Factor
protected function updateMessageVariable(Message $message, Variable $variable): float
{
throw new Exception();
throw new Exception("Must override updateMessageVariable(" . $message::class . ", " . $variable::class . ")");
}
/**

@ -70,7 +70,7 @@ abstract class FactorGraphLayer
/**
* @param Schedule[] $itemsToSequence
*/
protected function scheduleSequence(array $itemsToSequence, string $name): ScheduleSequence
protected function scheduleSequence(array $itemsToSequence): ScheduleSequence
{
return new ScheduleSequence($itemsToSequence);
}

@ -101,9 +101,9 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
),
];
//loop of just two teams inner sequence
return $this->scheduleSequence(
$itemsToSequence,
'loop of just two teams inner sequence'
$itemsToSequence
);
}
@ -120,10 +120,11 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
$currentTeamPerfToTeamPerfDiff = $teamPerformancesToTeamPerformanceDifferencesLayerLocalFactors[$i];
$currentTeamDiffComparison = $teamDifferencesComparisonLayerLocalFactors[$i];
//current forward schedule piece $i
$currentForwardSchedulePiece =
$this->scheduleSequence(
[
//team perf to perf diff
//team perf to perf diff
new ScheduleStep(
$currentTeamPerfToTeamPerfDiff,
0
@ -138,8 +139,7 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
$currentTeamPerfToTeamPerfDiff,
2
),
],
sprintf('current forward schedule piece %d', $i)
]
);
$forwardScheduleList[] = $currentForwardSchedulePiece;

@ -36,13 +36,13 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
{
$localFactors = $this->getLocalFactors();
//all player perf to team perf schedule
return $this->scheduleSequence(
array_map(
//Perf to Team Perf Step
static fn($weightedSumFactor): ScheduleStep => new ScheduleStep($weightedSumFactor, 0),
$localFactors
),
'all player perf to team perf schedule'
)
);
}
@ -82,7 +82,8 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
}
}
return $this->scheduleSequence($allFactors, "all of the team's sum iterations");
//all of the team's sum iterations
return $this->scheduleSequence($allFactors);
}
/**

@ -53,13 +53,13 @@ class PlayerPriorValuesToSkillsLayer extends TrueSkillFactorGraphLayer
{
$localFactors = $this->getLocalFactors();
//All priors
return $this->scheduleSequence(
array_map(
//Prior to Skill Step
static fn($prior): ScheduleStep => new ScheduleStep($prior, 0),
$localFactors
),
'All priors'
)
);
}

@ -55,13 +55,13 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
{
$localFactors = $this->getLocalFactors();
//All skill to performance sending
return $this->scheduleSequence(
array_map(
//Skill to Perf step
static fn($likelihood): ScheduleStep => new ScheduleStep($likelihood, 0),
$localFactors
),
'All skill to performance sending'
)
);
}
@ -69,12 +69,12 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
{
$localFactors = $this->getLocalFactors();
//All skill to performance sending
return $this->scheduleSequence(
array_map(
static fn($likelihood): ScheduleStep => new ScheduleStep($likelihood, 1),
$localFactors
),
'All skill to performance sending'
)
);
}
}