Files
trueskill/src/FactorGraphs/FactorGraphLayer.php

69 lines
1.4 KiB
PHP
Raw Normal View History

2022-07-05 15:55:47 +02:00
<?php
namespace DNW\Skills\FactorGraphs;
abstract class FactorGraphLayer
{
2022-07-05 16:21:06 +02:00
private array $_localFactors = [];
2022-07-05 15:55:47 +02:00
2022-07-05 16:21:06 +02:00
private array $_outputVariablesGroups = [];
2022-07-05 15:55:47 +02:00
private $_inputVariablesGroups = [];
2022-07-05 16:21:06 +02:00
protected function __construct(private readonly FactorGraph $_parentFactorGraph)
{
}
protected function getInputVariablesGroups()
{
return $this->_inputVariablesGroups;
}
// HACK
public function getParentFactorGraph()
{
return $this->_parentFactorGraph;
}
/**
* This reference is still needed
*/
2023-08-01 12:26:38 +00:00
public function &getOutputVariablesGroups(): array
{
return $this->_outputVariablesGroups;
}
2023-08-01 12:26:38 +00:00
public function getLocalFactors(): array
{
return $this->_localFactors;
}
2023-08-01 12:26:38 +00:00
public function setInputVariablesGroups(array $value): void
{
$this->_inputVariablesGroups = $value;
}
2023-08-01 12:26:38 +00:00
protected function scheduleSequence(array $itemsToSequence, string $name): ScheduleSequence
{
return new ScheduleSequence($name, $itemsToSequence);
}
2023-08-01 12:26:38 +00:00
protected function addLayerFactor(Factor $factor): void
{
$this->_localFactors[] = $factor;
}
2022-07-05 15:55:47 +02:00
abstract public function buildLayer();
public function createPriorSchedule()
{
return null;
}
public function createPosteriorSchedule()
{
return null;
}
2022-07-05 15:55:47 +02:00
}