Fixed an array size issue because of ignored 0 value

This commit is contained in:
Jeff Moser
2010-10-02 14:17:48 -04:00
parent 803a0816a8
commit c22683ab33
7 changed files with 25 additions and 20 deletions

View File

@ -29,9 +29,10 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
{
$currentTeamPlayerPerformances = array();
foreach ($currentTeam as $playerSkillVariable)
foreach ($currentTeam as &$playerSkillVariable)
{
$playerPerformance = $this->createOutputVariable($playerSkillVariable->getKey());
$currentPlayer = &$playerSkillVariable->getKey();
$playerPerformance = $this->createOutputVariable($currentPlayer);
$newLikelihoodFactor = $this->createLikelihood($playerSkillVariable, $playerPerformance);
$this->addLayerFactor($newLikelihoodFactor);
$currentTeamPlayerPerformances[] = $playerPerformance;