mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 10:12:28 +01:00 
			
		
		
		
	Fixed some debugging messages on factors
This commit is contained in:
		@@ -34,7 +34,7 @@ abstract class GaussianFactor extends Factor
 | 
			
		||||
        return parent::createVariableToMessageBindingWithMessage($variable,
 | 
			
		||||
                                                      new Message(
 | 
			
		||||
                                                          GaussianDistribution::fromPrecisionMean(0, 0),
 | 
			
		||||
                                                          "message from {0} to {1}", $this));
 | 
			
		||||
                                                          sprintf("message from %s to %s", $this, $variable)));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ class GaussianGreaterThanFactor extends GaussianFactor
 | 
			
		||||
 | 
			
		||||
    public function __construct($epsilon, Variable &$variable)
 | 
			
		||||
    {
 | 
			
		||||
        parent::__construct("{0} > {1:0.000}");
 | 
			
		||||
        parent::__construct(\sprintf("%s > %.2f", $variable, $epsilon));
 | 
			
		||||
        $this->_epsilon = $epsilon;
 | 
			
		||||
        $this->createVariableToMessageBinding($variable);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ class GaussianLikelihoodFactor extends GaussianFactor
 | 
			
		||||
 | 
			
		||||
    public function __construct($betaSquared, Variable &$variable1, Variable &$variable2)
 | 
			
		||||
    {
 | 
			
		||||
        parent::__construct("Likelihood of {0} going to {1}");
 | 
			
		||||
        parent::__construct(sprintf("Likelihood of %s going to %s", $variable2, $variable1));
 | 
			
		||||
        $this->_precision = 1.0/$betaSquared;
 | 
			
		||||
        $this->createVariableToMessageBinding($variable1);
 | 
			
		||||
        $this->createVariableToMessageBinding($variable2);
 | 
			
		||||
 
 | 
			
		||||
@@ -21,11 +21,10 @@ class GaussianPriorFactor extends GaussianFactor
 | 
			
		||||
 | 
			
		||||
    public function __construct($mean, $variance, Variable &$variable)
 | 
			
		||||
    {
 | 
			
		||||
        parent::__construct("Prior value going to {0}");
 | 
			
		||||
        parent::__construct(sprintf("Prior value going to %s", $variable));
 | 
			
		||||
        $this->_newMessage = new GaussianDistribution($mean, sqrt($variance));
 | 
			
		||||
        $newMessage = new Message(GaussianDistribution::fromPrecisionMean(0, 0),
 | 
			
		||||
                                                       "message from {0} to {1}",
 | 
			
		||||
                                                   $this, $variable);
 | 
			
		||||
                                  sprintf("message from %s to %s", $this, $variable));
 | 
			
		||||
 | 
			
		||||
        $this->createVariableToMessageBindingWithMessage($variable, $newMessage);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@ class GaussianWithinFactor extends GaussianFactor
 | 
			
		||||
 | 
			
		||||
    public function __construct($epsilon, Variable &$variable)
 | 
			
		||||
    {
 | 
			
		||||
        parent::__construct(sprintf("%s <= %.2f", $variable, $epsilon));
 | 
			
		||||
        $this->_epsilon = $epsilon;
 | 
			
		||||
        $this->createVariableToMessageBinding($variable);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user