mirror of
https://github.com/furyfire/trueskill.git
synced 2025-09-17 23:48:22 +02:00
Even less strings
This commit is contained in:
@@ -8,7 +8,7 @@ use DNW\Skills\Guard;
|
||||
use DNW\Skills\HashMap;
|
||||
use Exception;
|
||||
|
||||
abstract class Factor implements \Stringable
|
||||
abstract class Factor
|
||||
{
|
||||
/**
|
||||
* @var Message[] $messages
|
||||
@@ -17,16 +17,13 @@ abstract class Factor implements \Stringable
|
||||
|
||||
private readonly HashMap $messageToVariableBinding;
|
||||
|
||||
private readonly string $name;
|
||||
|
||||
/**
|
||||
* @var Variable[] $variables
|
||||
*/
|
||||
private array $variables = [];
|
||||
|
||||
protected function __construct(string $name)
|
||||
protected function __construct()
|
||||
{
|
||||
$this->name = 'Factor[' . $name . ']';
|
||||
$this->messageToVariableBinding = new HashMap();
|
||||
}
|
||||
|
||||
@@ -121,9 +118,4 @@ abstract class Factor implements \Stringable
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
|
@@ -6,9 +6,9 @@ namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
use DNW\Skills\Numerics\GaussianDistribution;
|
||||
|
||||
class Message implements \Stringable
|
||||
class Message
|
||||
{
|
||||
public function __construct(private GaussianDistribution $value, private readonly string $name)
|
||||
public function __construct(private GaussianDistribution $value)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -21,9 +21,4 @@ class Message implements \Stringable
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user