Files
trueskill/src/FactorGraphs/Variable.php
2022-07-05 15:55:47 +02:00

40 lines
613 B
PHP

<?php
namespace DNW\Skills\FactorGraphs;
class Variable
{
private $_name;
private $_prior;
private $_value;
public function __construct($name, $prior)
{
$this->_name = 'Variable['.$name.']';
$this->_prior = $prior;
$this->resetToPrior();
}
public function getValue()
{
return $this->_value;
}
public function setValue($value)
{
$this->_value = $value;
}
public function resetToPrior()
{
$this->_value = $this->_prior;
}
public function __toString()
{
return $this->_name;
}
}