mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-19 12:24:28 +00:00
String based "name" for Variable class removed for performance
This commit is contained in:
@ -6,15 +6,12 @@ namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
use DNW\Skills\Numerics\GaussianDistribution;
|
||||
|
||||
class Variable implements \Stringable
|
||||
class Variable
|
||||
{
|
||||
private readonly string $name;
|
||||
|
||||
private mixed $value;
|
||||
|
||||
public function __construct(string $name, private GaussianDistribution $prior)
|
||||
public function __construct(private GaussianDistribution $prior)
|
||||
{
|
||||
$this->name = 'Variable[' . $name . ']';
|
||||
$this->resetToPrior();
|
||||
}
|
||||
|
||||
@ -32,9 +29,4 @@ class Variable implements \Stringable
|
||||
{
|
||||
$this->value = $this->prior;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user