mirror of
https://github.com/furyfire/trueskill.git
synced 2025-01-16 01:47:39 +00:00
This commit is contained in:
@ -77,7 +77,7 @@ abstract class Factor
|
|||||||
|
|
||||||
protected function updateMessageVariable(Message $message, Variable $variable): float
|
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
|
* @param Schedule[] $itemsToSequence
|
||||||
*/
|
*/
|
||||||
protected function scheduleSequence(array $itemsToSequence, string $name): ScheduleSequence
|
protected function scheduleSequence(array $itemsToSequence): ScheduleSequence
|
||||||
{
|
{
|
||||||
return new ScheduleSequence($itemsToSequence);
|
return new ScheduleSequence($itemsToSequence);
|
||||||
}
|
}
|
||||||
|
@ -101,9 +101,9 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
//loop of just two teams inner sequence
|
||||||
return $this->scheduleSequence(
|
return $this->scheduleSequence(
|
||||||
$itemsToSequence,
|
$itemsToSequence
|
||||||
'loop of just two teams inner sequence'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,6 +120,7 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
|
|||||||
$currentTeamPerfToTeamPerfDiff = $teamPerformancesToTeamPerformanceDifferencesLayerLocalFactors[$i];
|
$currentTeamPerfToTeamPerfDiff = $teamPerformancesToTeamPerformanceDifferencesLayerLocalFactors[$i];
|
||||||
$currentTeamDiffComparison = $teamDifferencesComparisonLayerLocalFactors[$i];
|
$currentTeamDiffComparison = $teamDifferencesComparisonLayerLocalFactors[$i];
|
||||||
|
|
||||||
|
//current forward schedule piece $i
|
||||||
$currentForwardSchedulePiece =
|
$currentForwardSchedulePiece =
|
||||||
$this->scheduleSequence(
|
$this->scheduleSequence(
|
||||||
[
|
[
|
||||||
@ -138,8 +139,7 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
|
|||||||
$currentTeamPerfToTeamPerfDiff,
|
$currentTeamPerfToTeamPerfDiff,
|
||||||
2
|
2
|
||||||
),
|
),
|
||||||
],
|
]
|
||||||
sprintf('current forward schedule piece %d', $i)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$forwardScheduleList[] = $currentForwardSchedulePiece;
|
$forwardScheduleList[] = $currentForwardSchedulePiece;
|
||||||
|
@ -36,13 +36,13 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
|
|||||||
{
|
{
|
||||||
$localFactors = $this->getLocalFactors();
|
$localFactors = $this->getLocalFactors();
|
||||||
|
|
||||||
|
//all player perf to team perf schedule
|
||||||
return $this->scheduleSequence(
|
return $this->scheduleSequence(
|
||||||
array_map(
|
array_map(
|
||||||
//Perf to Team Perf Step
|
//Perf to Team Perf Step
|
||||||
static fn($weightedSumFactor): ScheduleStep => new ScheduleStep($weightedSumFactor, 0),
|
static fn($weightedSumFactor): ScheduleStep => new ScheduleStep($weightedSumFactor, 0),
|
||||||
$localFactors
|
$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();
|
$localFactors = $this->getLocalFactors();
|
||||||
|
|
||||||
|
//All priors
|
||||||
return $this->scheduleSequence(
|
return $this->scheduleSequence(
|
||||||
array_map(
|
array_map(
|
||||||
//Prior to Skill Step
|
//Prior to Skill Step
|
||||||
static fn($prior): ScheduleStep => new ScheduleStep($prior, 0),
|
static fn($prior): ScheduleStep => new ScheduleStep($prior, 0),
|
||||||
$localFactors
|
$localFactors
|
||||||
),
|
)
|
||||||
'All priors'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,13 +55,13 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
|
|||||||
{
|
{
|
||||||
$localFactors = $this->getLocalFactors();
|
$localFactors = $this->getLocalFactors();
|
||||||
|
|
||||||
|
//All skill to performance sending
|
||||||
return $this->scheduleSequence(
|
return $this->scheduleSequence(
|
||||||
array_map(
|
array_map(
|
||||||
//Skill to Perf step
|
//Skill to Perf step
|
||||||
static fn($likelihood): ScheduleStep => new ScheduleStep($likelihood, 0),
|
static fn($likelihood): ScheduleStep => new ScheduleStep($likelihood, 0),
|
||||||
$localFactors
|
$localFactors
|
||||||
),
|
)
|
||||||
'All skill to performance sending'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,12 +69,12 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
|
|||||||
{
|
{
|
||||||
$localFactors = $this->getLocalFactors();
|
$localFactors = $this->getLocalFactors();
|
||||||
|
|
||||||
|
//All skill to performance sending
|
||||||
return $this->scheduleSequence(
|
return $this->scheduleSequence(
|
||||||
array_map(
|
array_map(
|
||||||
static fn($likelihood): ScheduleStep => new ScheduleStep($likelihood, 1),
|
static fn($likelihood): ScheduleStep => new ScheduleStep($likelihood, 1),
|
||||||
$localFactors
|
$localFactors
|
||||||
),
|
)
|
||||||
'All skill to performance sending'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user