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
{
private array $localFactors = [];
2022-07-05 15:55:47 +02:00
private array $outputVariablesGroups = [];
2022-07-05 15:55:47 +02:00
private $inputVariablesGroups = [];
2022-07-05 15:55:47 +02:00
protected function __construct(private readonly FactorGraph $parentFactorGraph)
{
}
protected function getInputVariablesGroups()
{
return $this->inputVariablesGroups;
}
// HACK
2023-08-02 10:10:57 +00:00
public function getParentFactorGraph(): FactorGraph
{
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
}