More debugging name cleanups along with a few reference tweaks. Next up: fixing the schedule and running it

This commit is contained in:
Jeff Moser 2010-09-27 22:26:28 -04:00
parent f816a766d7
commit 196d09429a
7 changed files with 9 additions and 9 deletions

@ -85,7 +85,7 @@ abstract class Factor
$index = count($this->_messages); $index = count($this->_messages);
$this->_messages[] = $message; $this->_messages[] = $message;
$this->_messageToVariableBinding->setValue($message, $variable); $this->_messageToVariableBinding->setValue($message, $variable);
$this->_variables[] = &$variable; $this->_variables[] = $variable;
return $message; return $message;
} }

@ -43,9 +43,9 @@ abstract class FactorGraphLayer
$this->_inputVariablesGroups = $value; $this->_inputVariablesGroups = $value;
} }
protected function scheduleSequence(&$itemsToSequence) protected function scheduleSequence(&$itemsToSequence, $name)
{ {
return new ScheduleSequence("TODO", $itemsToSequence); return new ScheduleSequence($name, $itemsToSequence);
} }
protected function addLayerFactor(&$factor) protected function addLayerFactor(&$factor)

@ -261,7 +261,7 @@ class GaussianDistribution
public function __toString() public function __toString()
{ {
return 'mean=' . $this->_mean . ' standardDeviation=' . $this->_standardDeviation; return sprintf("mean=%.4f standardDeviation=%.4f", $this->_mean, $this->_standardDeviation);
} }
} }
?> ?>

@ -72,7 +72,7 @@ class Rating
public function __toString() public function __toString()
{ {
return 'mean=' . $this->_mean . ' standardDeviation=' . $this->_standardDeviation; return sprintf("mean=%.4f, standardDeviation=%.4f", $this->_mean, $this->_standardDeviation);
} }
} }

@ -67,7 +67,7 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
"teamPerformanceToPerformanceDifferenceFactors[0] @ 1", "teamPerformanceToPerformanceDifferenceFactors[0] @ 1",
$localFactors[0], 1), $localFactors[0], 1),
new ScheduleStep( new ScheduleStep(
"teamPerformanceToPerformanceDifferenceFactors[teamTeamDifferences = {0} - 1] @ 2", sprintf("teamPerformanceToPerformanceDifferenceFactors[teamTeamDifferences = %d - 1] @ 2", $totalTeamDifferences),
$localFactors[$totalTeamDifferences - 1], 2) $localFactors[$totalTeamDifferences - 1], 2)
) )
); );

@ -74,7 +74,7 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
$numberOfMessages = $currentFactor->getNumberOfMessages(); $numberOfMessages = $currentFactor->getNumberOfMessages();
for($currentIteration = 1; $currentIteration < $numberOfMessages; $currentIteration++) for($currentIteration = 1; $currentIteration < $numberOfMessages; $currentIteration++)
{ {
$allFactors[] = new ScheduleStep("team sum perf @" + $currentIteration, $allFactors[] = new ScheduleStep("team sum perf @" . $currentIteration,
$currentFactor, $currentIteration); $currentFactor, $currentIteration);
} }
} }

@ -29,11 +29,11 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
$playerPerformance = $this->createOutputVariable($playerSkillVariable->getKey()); $playerPerformance = $this->createOutputVariable($playerSkillVariable->getKey());
$newLikelihoodFactor = $this->createLikelihood($playerSkillVariable, $playerPerformance); $newLikelihoodFactor = $this->createLikelihood($playerSkillVariable, $playerPerformance);
$this->addLayerFactor($newLikelihoodFactor); $this->addLayerFactor($newLikelihoodFactor);
$currentTeamPlayerPerformances[] = &$playerPerformance; $currentTeamPlayerPerformances[] = $playerPerformance;
} }
$outputVariablesGroups = &$this->getOutputVariablesGroups(); $outputVariablesGroups = &$this->getOutputVariablesGroups();
$outputVariablesGroups[] = &$currentTeamPlayerPerformances; $outputVariablesGroups[] = $currentTeamPlayerPerformances;
} }
} }