mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-17 19:44:26 +00:00
33 lines
568 B
PHP
33 lines
568 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DNW\Skills\FactorGraphs;
|
|
|
|
use DNW\Skills\Numerics\GaussianDistribution;
|
|
|
|
class Variable
|
|
{
|
|
private mixed $value;
|
|
|
|
public function __construct(private GaussianDistribution $prior)
|
|
{
|
|
$this->resetToPrior();
|
|
}
|
|
|
|
public function getValue(): GaussianDistribution
|
|
{
|
|
return $this->value;
|
|
}
|
|
|
|
public function setValue(GaussianDistribution $value): void
|
|
{
|
|
$this->value = $value;
|
|
}
|
|
|
|
public function resetToPrior(): void
|
|
{
|
|
$this->value = $this->prior;
|
|
}
|
|
}
|