Pint applied for formatting

This commit is contained in:
Alex Wulf
2022-07-05 15:55:47 +02:00
parent bfc558d1f2
commit 7d4547df6a
68 changed files with 670 additions and 402 deletions

View File

@ -1,9 +1,11 @@
<?php namespace DNW\Skills\TrueSkill\Factors;
<?php
namespace DNW\Skills\TrueSkill\Factors;
use DNW\Skills\Numerics\GaussianDistribution;
use DNW\Skills\TrueSkill\TruncatedGaussianCorrectionFunctions;
use DNW\Skills\FactorGraphs\Message;
use DNW\Skills\FactorGraphs\Variable;
use DNW\Skills\Numerics\GaussianDistribution;
use DNW\Skills\TrueSkill\TruncatedGaussianCorrectionFunctions;
/**
* Factor representing a team difference that has exceeded the draw margin.
@ -16,7 +18,7 @@ class GaussianGreaterThanFactor extends GaussianFactor
public function __construct($epsilon, Variable $variable)
{
parent::__construct(\sprintf("%s > %.2f", $variable, $epsilon));
parent::__construct(\sprintf('%s > %.2f', $variable, $epsilon));
$this->_epsilon = $epsilon;
$this->createVariableToMessageBinding($variable);
}
@ -31,6 +33,7 @@ class GaussianGreaterThanFactor extends GaussianFactor
$messages = $this->getMessages();
$message = $messages[0]->getValue();
$messageFromVariable = GaussianDistribution::divide($marginal, $message);
return -GaussianDistribution::logProductNormalization($messageFromVariable, $message)
+
log(
@ -39,7 +42,6 @@ class GaussianGreaterThanFactor extends GaussianFactor
$messageFromVariable->getStandardDeviation()
)
);
}
protected function updateMessageVariable(Message $message, Variable $variable)
@ -82,4 +84,4 @@ class GaussianGreaterThanFactor extends GaussianFactor
// Return the difference in the new marginal
return GaussianDistribution::subtract($newMarginal, $oldMarginal);
}
}
}