mirror of
https://github.com/furyfire/trueskill.git
synced 2025-01-15 17:37:39 +00:00
More debugging name cleanups along with a few reference tweaks. Next up: fixing the schedule and running it
This commit is contained in:
@ -85,7 +85,7 @@ abstract class Factor
|
||||
$index = count($this->_messages);
|
||||
$this->_messages[] = $message;
|
||||
$this->_messageToVariableBinding->setValue($message, $variable);
|
||||
$this->_variables[] = &$variable;
|
||||
$this->_variables[] = $variable;
|
||||
return $message;
|
||||
}
|
||||
|
||||
|
@ -43,9 +43,9 @@ abstract class FactorGraphLayer
|
||||
$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)
|
||||
|
@ -261,7 +261,7 @@ class GaussianDistribution
|
||||
|
||||
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()
|
||||
{
|
||||
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",
|
||||
$localFactors[0], 1),
|
||||
new ScheduleStep(
|
||||
"teamPerformanceToPerformanceDifferenceFactors[teamTeamDifferences = {0} - 1] @ 2",
|
||||
sprintf("teamPerformanceToPerformanceDifferenceFactors[teamTeamDifferences = %d - 1] @ 2", $totalTeamDifferences),
|
||||
$localFactors[$totalTeamDifferences - 1], 2)
|
||||
)
|
||||
);
|
||||
|
@ -74,7 +74,7 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
|
||||
$numberOfMessages = $currentFactor->getNumberOfMessages();
|
||||
for($currentIteration = 1; $currentIteration < $numberOfMessages; $currentIteration++)
|
||||
{
|
||||
$allFactors[] = new ScheduleStep("team sum perf @" + $currentIteration,
|
||||
$allFactors[] = new ScheduleStep("team sum perf @" . $currentIteration,
|
||||
$currentFactor, $currentIteration);
|
||||
}
|
||||
}
|
||||
|
@ -29,11 +29,11 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
|
||||
$playerPerformance = $this->createOutputVariable($playerSkillVariable->getKey());
|
||||
$newLikelihoodFactor = $this->createLikelihood($playerSkillVariable, $playerPerformance);
|
||||
$this->addLayerFactor($newLikelihoodFactor);
|
||||
$currentTeamPlayerPerformances[] = &$playerPerformance;
|
||||
$currentTeamPlayerPerformances[] = $playerPerformance;
|
||||
}
|
||||
|
||||
$outputVariablesGroups = &$this->getOutputVariablesGroups();
|
||||
$outputVariablesGroups[] = &$currentTeamPlayerPerformances;
|
||||
$outputVariablesGroups[] = $currentTeamPlayerPerformances;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user