mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-18 20:04:28 +00:00
Fixing codestandards.
This commit is contained in:
@ -11,10 +11,11 @@ use Exception;
|
||||
// The whole purpose of this is to do a loop on the bottom
|
||||
class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
|
||||
{
|
||||
public function __construct(TrueSkillFactorGraph $parentGraph,
|
||||
private readonly TeamPerformancesToTeamPerformanceDifferencesLayer $_TeamPerformancesToTeamPerformanceDifferencesLayer,
|
||||
private readonly TeamDifferencesComparisonLayer $_TeamDifferencesComparisonLayer)
|
||||
{
|
||||
public function __construct(
|
||||
TrueSkillFactorGraph $parentGraph,
|
||||
private readonly TeamPerformancesToTeamPerformanceDifferencesLayer $_TeamPerformancesToTeamPerformanceDifferencesLayer,
|
||||
private readonly TeamDifferencesComparisonLayer $_TeamDifferencesComparisonLayer
|
||||
) {
|
||||
parent::__construct($parentGraph);
|
||||
}
|
||||
|
||||
@ -142,13 +143,16 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
|
||||
[
|
||||
new ScheduleStep(
|
||||
sprintf('teamPerformanceToPerformanceDifferenceFactors[totalTeamDifferences - 1 - %d] @ 0', $i),
|
||||
$differencesFactor, 0),
|
||||
$differencesFactor, 0
|
||||
),
|
||||
new ScheduleStep(
|
||||
sprintf('greaterThanOrWithinResultFactors[totalTeamDifferences - 1 - %d] @ 0', $i),
|
||||
$comparisonFactor, 0),
|
||||
$comparisonFactor, 0
|
||||
),
|
||||
new ScheduleStep(
|
||||
sprintf('teamPerformanceToPerformanceDifferenceFactors[totalTeamDifferences - 1 - %d] @ 1', $i),
|
||||
$performancesToDifferencesFactor, 1),
|
||||
$performancesToDifferencesFactor, 1
|
||||
),
|
||||
]);
|
||||
$backwardScheduleList[] = $currentBackwardSchedulePiece;
|
||||
}
|
||||
@ -158,13 +162,15 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
|
||||
$forwardBackwardScheduleToLoop =
|
||||
new ScheduleSequence(
|
||||
'forward Backward Schedule To Loop',
|
||||
[$forwardSchedule, $backwardSchedule]);
|
||||
[$forwardSchedule, $backwardSchedule]
|
||||
);
|
||||
|
||||
$initialMaxDelta = 0.0001;
|
||||
|
||||
return new ScheduleLoop(
|
||||
sprintf('loop with max delta of %f', $initialMaxDelta),
|
||||
$forwardBackwardScheduleToLoop,
|
||||
$initialMaxDelta);
|
||||
$initialMaxDelta
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -40,9 +40,9 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
|
||||
);
|
||||
}
|
||||
|
||||
private function createOutputVariable($key)
|
||||
private function createOutputVariable($key): KeyedVariable
|
||||
{
|
||||
return $this->getParentFactorGraph()->getVariableFactory()->createKeyedVariable($key, $key."'s performance");
|
||||
return $this->getParentFactorGraph()->getVariableFactory()->createKeyedVariable($key, $key . "'s performance");
|
||||
}
|
||||
|
||||
public function createPriorSchedule(): ScheduleSequence
|
||||
@ -52,8 +52,10 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
|
||||
return $this->scheduleSequence(
|
||||
array_map(
|
||||
fn ($likelihood) => new ScheduleStep('Skill to Perf step', $likelihood, 0),
|
||||
$localFactors),
|
||||
'All skill to performance sending');
|
||||
$localFactors
|
||||
),
|
||||
'All skill to performance sending'
|
||||
);
|
||||
}
|
||||
|
||||
public function createPosteriorSchedule(): ScheduleSequence
|
||||
@ -63,7 +65,9 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
|
||||
return $this->scheduleSequence(
|
||||
array_map(
|
||||
fn ($likelihood) => new ScheduleStep('name', $likelihood, 1),
|
||||
$localFactors),
|
||||
'All skill to performance sending');
|
||||
$localFactors
|
||||
),
|
||||
'All skill to performance sending'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user