mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-15 02:24:28 +00:00
40 lines
613 B
PHP
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;
|
|
}
|
|
}
|