diff --git a/PHPSkills/FactorGraphs/Factor.php b/PHPSkills/FactorGraphs/Factor.php index a3a911a..cf7e2d3 100644 --- a/PHPSkills/FactorGraphs/Factor.php +++ b/PHPSkills/FactorGraphs/Factor.php @@ -1,13 +1,13 @@ _messages); $this->_messages[] = $message; - $this->_messageToVariableBinding->setValue($message) = $variable; + $this->_messageToVariableBinding->setValue($message, $variable); $this->_variables[] = $variable; return $message; } diff --git a/PHPSkills/FactorGraphs/FactorList.php b/PHPSkills/FactorGraphs/FactorList.php index 97d9d99..bc6db9a 100644 --- a/PHPSkills/FactorGraphs/FactorList.php +++ b/PHPSkills/FactorGraphs/FactorList.php @@ -2,7 +2,7 @@ namespace Moserware\Skills\FactorGraphs; -require_once(dirname(__FILE__) . "Factor.php"); +require_once(dirname(__FILE__) . "./Factor.php"); /// /// Helper class for computing the factor graph's normalization constant. diff --git a/PHPSkills/FactorGraphs/Schedule.php b/PHPSkills/FactorGraphs/Schedule.php index 0c432ab..4ac941a 100644 --- a/PHPSkills/FactorGraphs/Schedule.php +++ b/PHPSkills/FactorGraphs/Schedule.php @@ -30,7 +30,7 @@ class ScheduleStep extends Schedule $this->_index = $index; } - public function visit($depth, $maxDepth) + public function visit($depth = -1, $maxDepth = 0) { $delta = $this->_factor->updateMessageIndex($this->_index); return $delta; @@ -47,7 +47,7 @@ class ScheduleSequence extends Schedule $this->_schedules = $schedules; } - public function visit($depth, $maxDepth) + public function visit($depth = -1, $maxDepth = 0) { $maxDelta = 0; @@ -72,7 +72,7 @@ class ScheduleLoop extends Schedule $this->_maxDelta = $maxDelta; } - public function visit($depth, $maxDepth) + public function visit($depth = -1, $maxDepth = 0) { $totalIterations = 1; $delta = $this->_scheduleToLoop->visit($depth + 1, $maxDepth); diff --git a/PHPSkills/TrueSkill/TrueSkillFactorGraph.php b/PHPSkills/TrueSkill/TrueSkillFactorGraph.php index 9ceed88..cbd294d 100644 --- a/PHPSkills/TrueSkill/TrueSkillFactorGraph.php +++ b/PHPSkills/TrueSkill/TrueSkillFactorGraph.php @@ -1,11 +1,11 @@ addTest( new TwoTeamTrueSkillCalculatorTest("testFactorGraphTrueSkillCalculator")); + +\PHPUnit_TextUI_TestRunner::run($testSuite); +?>