mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-18 20:04:28 +00:00
Cleanup in src/, adding namespaces, removing php closing tag and general code cleanup
This commit is contained in:
@ -1,14 +1,8 @@
|
||||
<?php
|
||||
namespace Moserware\Skills\TrueSkill\Factors;
|
||||
<?php namespace Moserware\Skills\TrueSkill\Factors;
|
||||
|
||||
require_once(dirname(__FILE__) . "/../../FactorGraphs/Message.php");
|
||||
require_once(dirname(__FILE__) . "/../../FactorGraphs/Variable.php");
|
||||
require_once(dirname(__FILE__) . "/../../Numerics/GaussianDistribution.php");
|
||||
require_once(dirname(__FILE__) . "/GaussianFactor.php");
|
||||
|
||||
use Moserware\Numerics\GaussianDistribution;
|
||||
use Moserware\Skills\FactorGraphs\Message;
|
||||
use Moserware\Skills\FactorGraphs\Variable;
|
||||
use Moserware\Skills\Numerics\GaussianDistribution;
|
||||
|
||||
/**
|
||||
* Supplies the factor graph with prior information.
|
||||
@ -24,7 +18,7 @@ class GaussianPriorFactor extends GaussianFactor
|
||||
parent::__construct(sprintf("Prior value going to %s", $variable));
|
||||
$this->_newMessage = new GaussianDistribution($mean, sqrt($variance));
|
||||
$newMessage = new Message(GaussianDistribution::fromPrecisionMean(0, 0),
|
||||
sprintf("message from %s to %s", $this, $variable));
|
||||
sprintf("message from %s to %s", $this, $variable));
|
||||
|
||||
$this->createVariableToMessageBindingWithMessage($variable, $newMessage);
|
||||
}
|
||||
@ -43,6 +37,4 @@ class GaussianPriorFactor extends GaussianFactor
|
||||
$message->setValue($newMessage);
|
||||
return GaussianDistribution::subtract($oldMarginal, $newMarginal);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
Reference in New Issue
Block a user