Cleaned up some of the run schedule parts

This commit is contained in:
Jeff Moser
2010-09-28 08:12:06 -04:00
parent 196d09429a
commit a45a1c47da
8 changed files with 21 additions and 13 deletions

View File

@ -25,7 +25,7 @@ abstract class GaussianFactor extends Factor
$marginal = &$variable->getValue();
$messageValue = &$message->getValue();
$logZ = GaussianDistribution::logProductNormalization($marginal, $messageValue);
$variable->setValue($marginal*$messageValue);
$variable->setValue(GaussianDistribution::multiply($marginal, $messageValue));
return $logZ;
}

View File

@ -66,8 +66,8 @@ class GaussianLikelihoodFactor extends GaussianFactor
public function updateMessageIndex($messageIndex)
{
$messages = $this->getMessages();
$vars = $this->getVariables();
$messages = &$this->getMessages();
$vars = &$this->getVariables();
switch ($messageIndex)
{

View File

@ -91,7 +91,7 @@ class TrueSkillFactorGraph extends FactorGraph
foreach ($this->_layers as $currentLayer)
{
foreach ($currentLayer->getFactors() as $currentFactor)
foreach ($currentLayer->getLocalFactors() as $currentFactor)
{
$factorList->addFactor($currentFactor);
}
@ -107,10 +107,10 @@ class TrueSkillFactorGraph extends FactorGraph
foreach ($this->_layers as $currentLayer)
{
$currentPriorSchedule = &$currentLayer->createPriorSchedule();
$currentPriorSchedule = $currentLayer->createPriorSchedule();
if ($currentPriorSchedule != null)
{
$fullSchedule[] = &$currentPriorSchedule;
$fullSchedule[] = $currentPriorSchedule;
}
}