mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-19 20:34:28 +00:00
More type work.
This commit is contained in:
@ -14,16 +14,16 @@ use DNW\Skills\TrueSkill\TruncatedGaussianCorrectionFunctions;
|
||||
*/
|
||||
class GaussianGreaterThanFactor extends GaussianFactor
|
||||
{
|
||||
private $epsilon;
|
||||
private float $epsilon;
|
||||
|
||||
public function __construct($epsilon, Variable $variable)
|
||||
public function __construct(float $epsilon, Variable $variable)
|
||||
{
|
||||
parent::__construct(\sprintf('%s > %.2f', $variable, $epsilon));
|
||||
$this->epsilon = $epsilon;
|
||||
$this->createVariableToMessageBinding($variable);
|
||||
}
|
||||
|
||||
public function getLogNormalization()
|
||||
public function getLogNormalization(): float
|
||||
{
|
||||
/**
|
||||
* @var Variable[] $vars
|
||||
@ -48,7 +48,7 @@ class GaussianGreaterThanFactor extends GaussianFactor
|
||||
);
|
||||
}
|
||||
|
||||
protected function updateMessageVariable(Message $message, Variable $variable)
|
||||
protected function updateMessageVariable(Message $message, Variable $variable): float
|
||||
{
|
||||
$oldMarginal = clone $variable->getValue();
|
||||
$oldMessage = clone $message->getValue();
|
||||
|
@ -70,7 +70,7 @@ class GaussianLikelihoodFactor extends GaussianFactor
|
||||
return GaussianDistribution::subtract($newMarginal, $marginal1);
|
||||
}
|
||||
|
||||
public function updateMessageIndex($messageIndex): float
|
||||
public function updateMessageIndex(int $messageIndex): float
|
||||
{
|
||||
$messages = $this->getMessages();
|
||||
$vars = $this->getVariables();
|
||||
|
Reference in New Issue
Block a user