Two less warnings.

This commit is contained in:
Jens True 2023-08-03 13:50:58 +00:00
parent 0814be726a
commit e90b287096
2 changed files with 4 additions and 2 deletions

@ -2,6 +2,7 @@
namespace DNW\Skills\FactorGraphs; namespace DNW\Skills\FactorGraphs;
use DNW\Skills\FactorGraphs\ScheduleSequence; use DNW\Skills\FactorGraphs\ScheduleSequence;
use DNW\Skills\TrueSkill\TrueSkillFactorGraph;
abstract class FactorGraphLayer abstract class FactorGraphLayer
{ {
@ -19,7 +20,7 @@ abstract class FactorGraphLayer
*/ */
private $inputVariablesGroups = []; private $inputVariablesGroups = [];
protected function __construct(private readonly FactorGraph $parentFactorGraph) protected function __construct(private readonly TrueSkillFactorGraph $parentFactorGraph)
{ {
} }
@ -33,7 +34,7 @@ abstract class FactorGraphLayer
// HACK // HACK
public function getParentFactorGraph(): FactorGraph public function getParentFactorGraph(): TrueSkillFactorGraph
{ {
return $this->parentFactorGraph; return $this->parentFactorGraph;
} }

@ -61,6 +61,7 @@ class PlayerPriorValuesToSkillsLayer extends TrueSkillFactorGraphLayer
private function createPriorFactor(Rating $priorRating, Variable $skillsVariable): GaussianPriorFactor private function createPriorFactor(Rating $priorRating, Variable $skillsVariable): GaussianPriorFactor
{ {
echo (get_class($this->getParentFactorGraph()).PHP_EOL);
return new GaussianPriorFactor( return new GaussianPriorFactor(
$priorRating->getMean(), $priorRating->getMean(),
BasicMath::square($priorRating->getStandardDeviation()) + BasicMath::square($priorRating->getStandardDeviation()) +