mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 02:02:29 +01:00 
			
		
		
		
	More coding standards.
Diagrams in API documentation
This commit is contained in:
		@@ -24,7 +24,7 @@ abstract class FactorGraphLayer
 | 
			
		||||
     */
 | 
			
		||||
    private array $inputVariablesGroups = [];
 | 
			
		||||
 | 
			
		||||
    protected function __construct(private readonly TrueSkillFactorGraph $parentFactorGraph)
 | 
			
		||||
    public function __construct(private readonly TrueSkillFactorGraph $parentFactorGraph)
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ final class BasicMath
 | 
			
		||||
    /**
 | 
			
		||||
     * Sums the items in $itemsToSum
 | 
			
		||||
     *
 | 
			
		||||
     * @param mixed[]    $itemsToSum The items to sum,
 | 
			
		||||
     * @param mixed[]    $itemsToSum The items to sum.
 | 
			
		||||
     * @param \Closure $callback   The function to apply to each array element before summing.
 | 
			
		||||
     *
 | 
			
		||||
     * @return float The sum.
 | 
			
		||||
 
 | 
			
		||||
@@ -34,8 +34,9 @@ final class GaussianDistribution
 | 
			
		||||
     */
 | 
			
		||||
    private const float M_LOG_SQRT_2_PI = 0.9189385332046727417803297364056176398613974736377834128171515404;
 | 
			
		||||
 | 
			
		||||
    // precision and precisionMean are used because they make multiplying and dividing simpler
 | 
			
		||||
    // (see the accompanying math paper for more details)
 | 
			
		||||
    /**
 | 
			
		||||
     * Precision and precisionMean are used because they make multiplying and dividing simpler.
 | 
			
		||||
     */
 | 
			
		||||
    private float $precision = 1.0;
 | 
			
		||||
 | 
			
		||||
    private float $precisionMean = 0.0;
 | 
			
		||||
 
 | 
			
		||||
@@ -13,14 +13,20 @@ final readonly class Player implements ISupportPartialPlay, ISupportPartialUpdat
 | 
			
		||||
 | 
			
		||||
    private const float DEFAULT_PARTIAL_UPDATE_PERCENTAGE = 1.0;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var float The weight percentage to give this player when calculating a new rank.
 | 
			
		||||
     */
 | 
			
		||||
    private float $PartialPlayPct;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var float Indicated how much of a skill update a player should receive where 0 represents no update and 1.0 represents 100% of the update.
 | 
			
		||||
     */
 | 
			
		||||
    private float $PartialUpdatePct;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Constructs a player.
 | 
			
		||||
     *
 | 
			
		||||
     * @param string|int $Id                      The identifier for the player, such as a name.
 | 
			
		||||
     * @param string|int $Id          The identifier for the player, such as a name.
 | 
			
		||||
     * @param float $partialPlayPct   The weight percentage to give this player when calculating a new rank.
 | 
			
		||||
     * @param float $partialUpdatePct Indicated how much of a skill update a player should receive where 0 represents no update and 1.0 represents 100% of the update.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,9 @@ namespace DNW\Skills;
 | 
			
		||||
 | 
			
		||||
class RatingContainer
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Link Player to a Rating using a hash map.
 | 
			
		||||
     */
 | 
			
		||||
    private readonly HashMap $playerToRating;
 | 
			
		||||
 | 
			
		||||
    public function __construct()
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,4 @@ use DNW\Skills\TrueSkill\TrueSkillFactorGraph;
 | 
			
		||||
 | 
			
		||||
abstract class TrueSkillFactorGraphLayer extends FactorGraphLayer
 | 
			
		||||
{
 | 
			
		||||
    public function __construct(TrueSkillFactorGraph $parentGraph)
 | 
			
		||||
    {
 | 
			
		||||
        parent::__construct($parentGraph);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user