General cleanup and removal of all unnecessary references

This commit is contained in:
Alexander Liljengård
2016-05-24 16:31:21 +02:00
parent 519ad85fad
commit a65f2aa9f3
43 changed files with 366 additions and 386 deletions

View File

@ -43,8 +43,7 @@ class FactorGraphTrueSkillCalculator extends SkillCalculator
return $factorGraph->getUpdatedRatings();
}
public function calculateMatchQuality(GameInfo $gameInfo,
array &$teams)
public function calculateMatchQuality(GameInfo $gameInfo, array $teams)
{
// We need to create the A matrix which is the player team assigments.
$teamAssignmentsList = $teams;
@ -87,7 +86,7 @@ class FactorGraphTrueSkillCalculator extends SkillCalculator
return $result;
}
private static function getPlayerMeansVector(array &$teamAssignmentsList)
private static function getPlayerMeansVector(array $teamAssignmentsList)
{
// A simple vector of all the player means.
return new Vector(self::getPlayerRatingValues($teamAssignmentsList,
@ -96,7 +95,7 @@ class FactorGraphTrueSkillCalculator extends SkillCalculator
}));
}
private static function getPlayerCovarianceMatrix(array &$teamAssignmentsList)
private static function getPlayerCovarianceMatrix(array $teamAssignmentsList)
{
// This is a square matrix whose diagonal values represent the variance (square of standard deviation) of all
// players.
@ -108,8 +107,7 @@ class FactorGraphTrueSkillCalculator extends SkillCalculator
}
// Helper function that gets a list of values for all player ratings
private static function getPlayerRatingValues(array &$teamAssignmentsList,
$playerRatingFunction)
private static function getPlayerRatingValues(array $teamAssignmentsList, $playerRatingFunction)
{
$playerRatingValues = array();
@ -122,7 +120,7 @@ class FactorGraphTrueSkillCalculator extends SkillCalculator
return $playerRatingValues;
}
private static function createPlayerTeamAssignmentMatrix(&$teamAssignmentsList, $totalPlayers)
private static function createPlayerTeamAssignmentMatrix($teamAssignmentsList, $totalPlayers)
{
// The team assignment matrix is often referred to as the "A" matrix. It's a matrix whose rows represent the players
// and the columns represent teams. At Matrix[row, column] represents that player[row] is on team[col]