diff --git a/PHPSkills/Elo/GaussianEloCalculator.php b/PHPSkills/Elo/GaussianEloCalculator.php
index ff16154..717e3e3 100644
--- a/PHPSkills/Elo/GaussianEloCalculator.php
+++ b/PHPSkills/Elo/GaussianEloCalculator.php
@@ -1,6 +1,14 @@
diff --git a/PHPSkills/FactorGraphs/FactorList.php b/PHPSkills/FactorGraphs/FactorList.php
index a875e5f..97d9d99 100644
--- a/PHPSkills/FactorGraphs/FactorList.php
+++ b/PHPSkills/FactorGraphs/FactorList.php
@@ -2,6 +2,8 @@
namespace Moserware\Skills\FactorGraphs;
+require_once(dirname(__FILE__) . "Factor.php");
+
///
/// Helper class for computing the factor graph's normalization constant.
///
diff --git a/PHPSkills/FactorGraphs/VariableFactory.php b/PHPSkills/FactorGraphs/VariableFactory.php
index 08c4900..0f13683 100644
--- a/PHPSkills/FactorGraphs/VariableFactory.php
+++ b/PHPSkills/FactorGraphs/VariableFactory.php
@@ -2,6 +2,8 @@
namespace Moserware\Skills\FactorGraphs;
+require_once(dirname(__FILE__) . "Variable.php");
+
class VariableFactory
{
// using a Func to encourage fresh copies in case it's overwritten
@@ -23,6 +25,6 @@ class VariableFactory
$newVar = new KeyedVariable($key, $this->_variablePriorInitializer());
return $newVar;
}
-}s
+}
?>
diff --git a/PHPSkills/TrueSkill/FactorGraphTrueSkillCalculator.php b/PHPSkills/TrueSkill/FactorGraphTrueSkillCalculator.php
index 2765c62..695867e 100644
--- a/PHPSkills/TrueSkill/FactorGraphTrueSkillCalculator.php
+++ b/PHPSkills/TrueSkill/FactorGraphTrueSkillCalculator.php
@@ -2,6 +2,34 @@
namespace Moserware\Skills\TrueSkill;
+require_once(dirname(__FILE__) . "/../GameInfo.php");
+require_once(dirname(__FILE__) . "/../Guard.php");
+require_once(dirname(__FILE__) . "/../ISupportPartialPlay.php");
+require_once(dirname(__FILE__) . "/../ISupportPartialUpdate.php");
+require_once(dirname(__FILE__) . "/../PartialPlay.php");
+require_once(dirname(__FILE__) . "/../PlayersRange.php");
+require_once(dirname(__FILE__) . "/../RankSorter.php");
+require_once(dirname(__FILE__) . "/../SkillCalculator.php");
+require_once(dirname(__FILE__) . "/../TeamsRange.php");
+require_once(dirname(__FILE__) . "/../Numerics/BasicMath.php");
+require_once(dirname(__FILE__) . "/../Numerics/Matrix.php");
+require_once(dirname(__FILE__) . "/TrueSkillFactorGraph.php");
+
+use Moserware\Numerics\DiagonalMatrix;
+use Moserware\Numerics\Matrix;
+use Moserware\Numerics\Vector;
+
+use Moserware\Skills\GameInfo;
+use Moserware\Skills\Guard;
+use Moserware\Skills\ISupportPartialPlay;
+use Moserware\Skills\ISupportPartialUpdate;
+use Moserware\Skills\PartialPlay;
+use Moserware\Skills\PlayersRange;
+use Moserware\Skills\RankSorter;
+use Moserware\Skills\SkillCalculator;
+use Moserware\Skills\SkillCalculatorSupportedOptions;
+use Moserware\Skills\TeamsRange;
+
///
/// Calculates TrueSkill using a full factor graph.
///
@@ -30,12 +58,11 @@ class FactorGraphTrueSkillCalculator extends SkillCalculator
return $factorGraph->getUpdatedRatings();
}
-
public function calculateMatchQuality(GameInfo $gameInfo,
array $teams)
{
// We need to create the A matrix which is the player team assigments.
- $teamAssignmentsList = $teams.ToList();
+ $teamAssignmentsList = $teams;
$skillsMatrix = $this->getPlayerCovarianceMatrix($teamAssignmentsList);
$meanVector = $this->getPlayerMeansVector($teamAssignmentsList);
$meanVectorTranspose = $meanVector->getTranspose();
diff --git a/PHPSkills/TrueSkill/Layers/IteratedTeamDifferencesInnerLayer.php b/PHPSkills/TrueSkill/Layers/IteratedTeamDifferencesInnerLayer.php
index b427617..b830381 100644
--- a/PHPSkills/TrueSkill/Layers/IteratedTeamDifferencesInnerLayer.php
+++ b/PHPSkills/TrueSkill/Layers/IteratedTeamDifferencesInnerLayer.php
@@ -1,14 +1,16 @@
getOutputVariablesGroups();
+ $outputVariablesGroups[] = $currentTeamSkills;
}
}
diff --git a/PHPSkills/TrueSkill/Layers/PlayerSkillsToPerformancesLayer.php b/PHPSkills/TrueSkill/Layers/PlayerSkillsToPerformancesLayer.php
index 9e52fb6..95e40b4 100644
--- a/PHPSkills/TrueSkill/Layers/PlayerSkillsToPerformancesLayer.php
+++ b/PHPSkills/TrueSkill/Layers/PlayerSkillsToPerformancesLayer.php
@@ -1,7 +1,16 @@
getPartialPlayPercentage();
+
+ // HACK to get around bug near 0
+ $smallestPercentage = 0.0001;
+ if ($partialPlayPercentage < $smallestPercentage)
+ {
+ $partialPlayPercentage = $smallestPercentage;
+ }
+
+ return $partialPlayPercentage;
+ }
+}
+
+?>