mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-19 20:34:28 +00:00
More warnings resolved.
This commit is contained in:
@ -6,6 +6,11 @@ class FactorGraph
|
||||
{
|
||||
private VariableFactory $variableFactory;
|
||||
|
||||
public function __construct(VariableFactory $factory)
|
||||
{
|
||||
$this->variableFactory = $factory;
|
||||
}
|
||||
|
||||
public function getVariableFactory(): VariableFactory
|
||||
{
|
||||
return $this->variableFactory;
|
||||
|
@ -2,18 +2,20 @@
|
||||
|
||||
namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
use DNW\Skills\Numerics\GaussianDistribution;
|
||||
|
||||
class Message implements \Stringable
|
||||
{
|
||||
public function __construct(private ?object $value = null, private ?string $name = null)
|
||||
public function __construct(private GaussianDistribution $value, private string $name)
|
||||
{
|
||||
}
|
||||
|
||||
public function getValue(): ?object
|
||||
public function getValue(): GaussianDistribution
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function setValue(?object $value): void
|
||||
public function setValue(GaussianDistribution $value): void
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
@ -2,24 +2,26 @@
|
||||
|
||||
namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
use DNW\Skills\Numerics\GaussianDistribution;
|
||||
|
||||
class Variable implements \Stringable
|
||||
{
|
||||
private string $name;
|
||||
|
||||
private mixed $value;
|
||||
|
||||
public function __construct(string $name, private mixed $prior)
|
||||
public function __construct(string $name, private GaussianDistribution $prior)
|
||||
{
|
||||
$this->name = 'Variable[' . $name . ']';
|
||||
$this->resetToPrior();
|
||||
}
|
||||
|
||||
public function getValue(): mixed
|
||||
public function getValue(): GaussianDistribution
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function setValue(mixed $value): void
|
||||
public function setValue(GaussianDistribution $value): void
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user