More warnings resolved.

This commit is contained in:
2023-08-08 07:51:05 +00:00
parent aa836e859d
commit e49f01cd68
8 changed files with 23 additions and 23 deletions

View File

@ -6,6 +6,11 @@ class FactorGraph
{
private VariableFactory $variableFactory;
public function __construct(VariableFactory $factory)
{
$this->variableFactory = $factory;
}
public function getVariableFactory(): VariableFactory
{
return $this->variableFactory;

View File

@ -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;
}

View File

@ -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;
}