Files
trueskill/src/FactorGraphs/Variable.php

40 lines
613 B
PHP
Raw Normal View History

<?php
2022-07-05 15:55:47 +02:00
2022-07-05 15:33:34 +02:00
namespace DNW\Skills\FactorGraphs;
class Variable
{
private $_name;
2022-07-05 15:55:47 +02:00
private $_prior;
2022-07-05 15:55:47 +02:00
private $_value;
public function __construct($name, $prior)
{
2022-07-05 15:55:47 +02:00
$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;
}
2022-07-05 15:55:47 +02:00
}