mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 02:02:29 +01:00 
			
		
		
		
	This commit is contained in:
		@@ -77,7 +77,7 @@ abstract class Factor
 | 
			
		||||
 | 
			
		||||
    protected function updateMessageVariable(Message $message, Variable $variable): float
 | 
			
		||||
    {
 | 
			
		||||
        throw new Exception();
 | 
			
		||||
        throw new Exception("Must override updateMessageVariable(" . $message::class . ", " . $variable::class . ")");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -70,7 +70,7 @@ abstract class FactorGraphLayer
 | 
			
		||||
    /**
 | 
			
		||||
     * @param Schedule[] $itemsToSequence
 | 
			
		||||
     */
 | 
			
		||||
    protected function scheduleSequence(array $itemsToSequence, string $name): ScheduleSequence
 | 
			
		||||
    protected function scheduleSequence(array $itemsToSequence): ScheduleSequence
 | 
			
		||||
    {
 | 
			
		||||
        return new ScheduleSequence($itemsToSequence);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -101,9 +101,9 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
 | 
			
		||||
            ),
 | 
			
		||||
        ];
 | 
			
		||||
 | 
			
		||||
        //loop of just two teams inner sequence
 | 
			
		||||
        return $this->scheduleSequence(
 | 
			
		||||
            $itemsToSequence,
 | 
			
		||||
            'loop of just two teams inner sequence'
 | 
			
		||||
            $itemsToSequence
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -120,10 +120,11 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
 | 
			
		||||
            $currentTeamPerfToTeamPerfDiff = $teamPerformancesToTeamPerformanceDifferencesLayerLocalFactors[$i];
 | 
			
		||||
            $currentTeamDiffComparison = $teamDifferencesComparisonLayerLocalFactors[$i];
 | 
			
		||||
 | 
			
		||||
            //current forward schedule piece $i
 | 
			
		||||
            $currentForwardSchedulePiece =
 | 
			
		||||
                $this->scheduleSequence(
 | 
			
		||||
                    [
 | 
			
		||||
                        //team perf to perf diff 
 | 
			
		||||
                        //team perf to perf diff
 | 
			
		||||
                        new ScheduleStep(
 | 
			
		||||
                            $currentTeamPerfToTeamPerfDiff,
 | 
			
		||||
                            0
 | 
			
		||||
@@ -138,8 +139,7 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
 | 
			
		||||
                            $currentTeamPerfToTeamPerfDiff,
 | 
			
		||||
                            2
 | 
			
		||||
                        ),
 | 
			
		||||
                    ],
 | 
			
		||||
                    sprintf('current forward schedule piece %d', $i)
 | 
			
		||||
                    ]
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
            $forwardScheduleList[] = $currentForwardSchedulePiece;
 | 
			
		||||
 
 | 
			
		||||
@@ -36,13 +36,13 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
 | 
			
		||||
    {
 | 
			
		||||
        $localFactors = $this->getLocalFactors();
 | 
			
		||||
 | 
			
		||||
        //all player perf to team perf schedule
 | 
			
		||||
        return $this->scheduleSequence(
 | 
			
		||||
            array_map(
 | 
			
		||||
                //Perf to Team Perf Step
 | 
			
		||||
                static fn($weightedSumFactor): ScheduleStep => new ScheduleStep($weightedSumFactor, 0),
 | 
			
		||||
                $localFactors
 | 
			
		||||
            ),
 | 
			
		||||
            'all player perf to team perf schedule'
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -82,7 +82,8 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $this->scheduleSequence($allFactors, "all of the team's sum iterations");
 | 
			
		||||
        //all of the team's sum iterations
 | 
			
		||||
        return $this->scheduleSequence($allFactors);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -53,13 +53,13 @@ class PlayerPriorValuesToSkillsLayer extends TrueSkillFactorGraphLayer
 | 
			
		||||
    {
 | 
			
		||||
        $localFactors = $this->getLocalFactors();
 | 
			
		||||
 | 
			
		||||
        //All priors
 | 
			
		||||
        return $this->scheduleSequence(
 | 
			
		||||
            array_map(
 | 
			
		||||
                //Prior to Skill Step
 | 
			
		||||
                static fn($prior): ScheduleStep => new ScheduleStep($prior, 0),
 | 
			
		||||
                $localFactors
 | 
			
		||||
            ),
 | 
			
		||||
            'All priors'
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -55,13 +55,13 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
 | 
			
		||||
    {
 | 
			
		||||
        $localFactors = $this->getLocalFactors();
 | 
			
		||||
 | 
			
		||||
        //All skill to performance sending
 | 
			
		||||
        return $this->scheduleSequence(
 | 
			
		||||
            array_map(
 | 
			
		||||
                //Skill to Perf step
 | 
			
		||||
                static fn($likelihood): ScheduleStep => new ScheduleStep($likelihood, 0),
 | 
			
		||||
                $localFactors
 | 
			
		||||
            ),
 | 
			
		||||
            'All skill to performance sending'
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -69,12 +69,12 @@ class PlayerSkillsToPerformancesLayer extends TrueSkillFactorGraphLayer
 | 
			
		||||
    {
 | 
			
		||||
        $localFactors = $this->getLocalFactors();
 | 
			
		||||
 | 
			
		||||
        //All skill to performance sending
 | 
			
		||||
        return $this->scheduleSequence(
 | 
			
		||||
            array_map(
 | 
			
		||||
                static fn($likelihood): ScheduleStep => new ScheduleStep($likelihood, 1),
 | 
			
		||||
                $localFactors
 | 
			
		||||
            ),
 | 
			
		||||
            'All skill to performance sending'
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user