getInputVariablesGroups(); $outputVariablesGroups = &$this->getOutputVariablesGroups(); foreach ($inputVariablesGroups as $currentTeam) { $currentTeamPlayerPerformances = []; foreach ($currentTeam as $playerSkillVariable) { $localPlayerSkillVariable = $playerSkillVariable; $currentPlayer = $localPlayerSkillVariable->getKey(); $playerPerformance = $this->createOutputVariable($currentPlayer); $newLikelihoodFactor = $this->createLikelihood($localPlayerSkillVariable, $playerPerformance); $this->addLayerFactor($newLikelihoodFactor); $currentTeamPlayerPerformances[] = $playerPerformance; } $outputVariablesGroups[] = $currentTeamPlayerPerformances; } } private function createLikelihood(KeyedVariable $playerSkill, KeyedVariable $playerPerformance): GaussianLikelihoodFactor { return new GaussianLikelihoodFactor( BasicMath::square($this->getParentFactorGraph()->getGameInfo()->getBeta()), $playerPerformance, $playerSkill ); } private function createOutputVariable(mixed $key): KeyedVariable { return $this->getParentFactorGraph()->getVariableFactory()->createKeyedVariable($key, $key . "'s performance"); } public function createPriorSchedule(): ScheduleSequence { $localFactors = $this->getLocalFactors(); return $this->scheduleSequence( array_map( fn ($likelihood) => new ScheduleStep('Skill to Perf step', $likelihood, 0), $localFactors ), 'All skill to performance sending' ); } public function createPosteriorSchedule(): ScheduleSequence { $localFactors = $this->getLocalFactors(); return $this->scheduleSequence( array_map( fn ($likelihood) => new ScheduleStep('name', $likelihood, 1), $localFactors ), 'All skill to performance sending' ); } }