mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-19 20:34:28 +00:00
No more use of _ to mark private variables.
This commit is contained in:
@ -4,26 +4,26 @@ namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
abstract class FactorGraphLayer
|
||||
{
|
||||
private array $_localFactors = [];
|
||||
private array $localFactors = [];
|
||||
|
||||
private array $_outputVariablesGroups = [];
|
||||
private array $outputVariablesGroups = [];
|
||||
|
||||
private $_inputVariablesGroups = [];
|
||||
private $inputVariablesGroups = [];
|
||||
|
||||
protected function __construct(private readonly FactorGraph $_parentFactorGraph)
|
||||
protected function __construct(private readonly FactorGraph $parentFactorGraph)
|
||||
{
|
||||
}
|
||||
|
||||
protected function getInputVariablesGroups()
|
||||
{
|
||||
return $this->_inputVariablesGroups;
|
||||
return $this->inputVariablesGroups;
|
||||
}
|
||||
|
||||
// HACK
|
||||
|
||||
public function getParentFactorGraph()
|
||||
{
|
||||
return $this->_parentFactorGraph;
|
||||
return $this->parentFactorGraph;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -31,17 +31,17 @@ abstract class FactorGraphLayer
|
||||
*/
|
||||
public function &getOutputVariablesGroups(): array
|
||||
{
|
||||
return $this->_outputVariablesGroups;
|
||||
return $this->outputVariablesGroups;
|
||||
}
|
||||
|
||||
public function getLocalFactors(): array
|
||||
{
|
||||
return $this->_localFactors;
|
||||
return $this->localFactors;
|
||||
}
|
||||
|
||||
public function setInputVariablesGroups(array $value): void
|
||||
{
|
||||
$this->_inputVariablesGroups = $value;
|
||||
$this->inputVariablesGroups = $value;
|
||||
}
|
||||
|
||||
protected function scheduleSequence(array $itemsToSequence, string $name): ScheduleSequence
|
||||
@ -51,7 +51,7 @@ abstract class FactorGraphLayer
|
||||
|
||||
protected function addLayerFactor(Factor $factor): void
|
||||
{
|
||||
$this->_localFactors[] = $factor;
|
||||
$this->localFactors[] = $factor;
|
||||
}
|
||||
|
||||
abstract public function buildLayer();
|
||||
|
@ -7,21 +7,21 @@ namespace DNW\Skills\FactorGraphs;
|
||||
*/
|
||||
class FactorList
|
||||
{
|
||||
private array $_list = [];
|
||||
private array $list = [];
|
||||
|
||||
public function getLogNormalization()
|
||||
{
|
||||
$list = $this->_list;
|
||||
$list = $this->list;
|
||||
foreach ($list as &$currentFactor) {
|
||||
$currentFactor->resetMarginals();
|
||||
}
|
||||
|
||||
$sumLogZ = 0.0;
|
||||
|
||||
$listCount = count($this->_list);
|
||||
$listCount = count($this->list);
|
||||
|
||||
for ($i = 0; $i < $listCount; $i++) {
|
||||
$f = $this->_list[$i];
|
||||
$f = $this->list[$i];
|
||||
|
||||
$numberOfMessages = $f->getNumberOfMessages();
|
||||
|
||||
@ -41,12 +41,12 @@ class FactorList
|
||||
|
||||
public function count()
|
||||
{
|
||||
return count($this->_list);
|
||||
return count($this->list);
|
||||
}
|
||||
|
||||
public function addFactor(Factor $factor)
|
||||
{
|
||||
$this->_list[] = $factor;
|
||||
$this->list[] = $factor;
|
||||
|
||||
return $factor;
|
||||
}
|
||||
|
Reference in New Issue
Block a user