diff --git a/PHPSkills/FactorGraphs/Factor.php b/PHPSkills/FactorGraphs/Factor.php index cf7e2d3..90e3b76 100644 --- a/PHPSkills/FactorGraphs/Factor.php +++ b/PHPSkills/FactorGraphs/Factor.php @@ -1,12 +1,15 @@ updateMessageVariable($this->_messages[$messageIndex], $this->_messageToVariableBinding->getValue($messageIndex)); } - protected function updateMessageVariable($message, $variable) + protected function updateMessageVariable(Message $message, Variable $variable) { throw new Exception(); } @@ -74,11 +77,11 @@ abstract class Factor return $this->sendMessageVariable($message, $variable); } - protected abstract function sendMessageVariable($message, $variable); + protected abstract function sendMessageVariable(Message $message, Variable $variable); - public abstract function createVariableToMessageBinding($variable); + public abstract function createVariableToMessageBinding(Variable $variable); - protected function createVariableToMessageBindingWithMessage($variable, $message) + protected function createVariableToMessageBindingWithMessage(Variable $variable, Variable $message) { $index = count($this->_messages); $this->_messages[] = $message; diff --git a/PHPSkills/FactorGraphs/FactorGraphLayer.php b/PHPSkills/FactorGraphs/FactorGraphLayer.php index bee99d4..56e2260 100644 --- a/PHPSkills/FactorGraphs/FactorGraphLayer.php +++ b/PHPSkills/FactorGraphs/FactorGraphLayer.php @@ -1,7 +1,7 @@ /// Helper class for computing the factor graph's normalization constant. diff --git a/PHPSkills/FactorGraphs/VariableFactory.php b/PHPSkills/FactorGraphs/VariableFactory.php index 0f13683..37146d8 100644 --- a/PHPSkills/FactorGraphs/VariableFactory.php +++ b/PHPSkills/FactorGraphs/VariableFactory.php @@ -2,7 +2,7 @@ namespace Moserware\Skills\FactorGraphs; -require_once(dirname(__FILE__) . "Variable.php"); +require_once(dirname(__FILE__) . "/Variable.php"); class VariableFactory { diff --git a/PHPSkills/SkillCalculator.php b/PHPSkills/SkillCalculator.php index 5f2d170..4d2fec3 100644 --- a/PHPSkills/SkillCalculator.php +++ b/PHPSkills/SkillCalculator.php @@ -1,6 +1,10 @@ A mapping of team players and their ratings. /// The ranks of the teams where 1 is first place. For a tie, repeat the number (e.g. 1, 2, 2) /// All the players and their new ratings. - public abstract function calculateNewRatings($gameInfo, + public abstract function calculateNewRatings(GameInfo $gameInfo, array $teamsOfPlayerToRatings, array $teamRanks); @@ -36,7 +40,7 @@ abstract class SkillCalculator /// Parameters for the game. /// A mapping of team players and their ratings. /// The quality of the match between the teams as a percentage (0% = bad, 100% = well matched). - public abstract function calculateMatchQuality($gameInfo, + public abstract function calculateMatchQuality(GameInfo $gameInfo, array $teamsOfPlayerToRatings); public function isSupported($option) diff --git a/PHPSkills/TrueSkill/FactorGraphTrueSkillCalculator.php b/PHPSkills/TrueSkill/FactorGraphTrueSkillCalculator.php index 695867e..2dc6a03 100644 --- a/PHPSkills/TrueSkill/FactorGraphTrueSkillCalculator.php +++ b/PHPSkills/TrueSkill/FactorGraphTrueSkillCalculator.php @@ -40,7 +40,7 @@ class FactorGraphTrueSkillCalculator extends SkillCalculator parent::__construct(SkillCalculatorSupportedOptions::PARTIAL_PLAY | SkillCalculatorSupportedOptions::PARTIAL_UPDATE, TeamsRange::atLeast(2), PlayersRange::atLeast(1)); } - public function CalculateNewRatings(GameInfo $gameInfo, + public function calculateNewRatings(GameInfo $gameInfo, array $teams, array $teamRanks) { diff --git a/PHPSkills/TrueSkill/Factors/GaussianFactor.php b/PHPSkills/TrueSkill/Factors/GaussianFactor.php index e868f97..e7599cf 100644 --- a/PHPSkills/TrueSkill/Factors/GaussianFactor.php +++ b/PHPSkills/TrueSkill/Factors/GaussianFactor.php @@ -2,10 +2,10 @@ namespace Moserware\Skills\TrueSkill\Factors; -require_once(dirname(__FILE__) . "../../FactorGraphs/Factor.php"); -require_once(dirname(__FILE__) . "../../FactorGraphs/Message.php"); -require_once(dirname(__FILE__) . "../../FactorGraphs/Variable.php"); -require_once(dirname(__FILE__) . "../../Numerics/GaussianDistribution.php"); +require_once(dirname(__FILE__) . "/../../FactorGraphs/Factor.php"); +require_once(dirname(__FILE__) . "/../../FactorGraphs/Message.php"); +require_once(dirname(__FILE__) . "/../../FactorGraphs/Variable.php"); +require_once(dirname(__FILE__) . "/../../Numerics/GaussianDistribution.php"); use Moserware\Numerics\GaussianDistribution; use Moserware\Skills\FactorGraphs\Factor; diff --git a/PHPSkills/TrueSkill/Factors/GaussianGreaterThanFactor.php b/PHPSkills/TrueSkill/Factors/GaussianGreaterThanFactor.php index b767451..130d0e5 100644 --- a/PHPSkills/TrueSkill/Factors/GaussianGreaterThanFactor.php +++ b/PHPSkills/TrueSkill/Factors/GaussianGreaterThanFactor.php @@ -1,11 +1,11 @@ addTest( new TwoTeamTrueSkillCalculatorTest("testFactorGraphTrueSkillCalculator")); +$testSuite->addTest( new FactorGraphTrueSkillCalculatorTest("testFactorGraphTrueSkillCalculator")); \PHPUnit_TextUI_TestRunner::run($testSuite); ?>