mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-16 11:04:27 +00:00
Pint applied for formatting
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user