Some minor documentation cleanup (e.g. converted C# comments to PHPDocumentor comments)

This commit is contained in:
Jeff Moser
2010-10-08 21:44:36 -04:00
parent f863e150d4
commit d2fc7dc5c7
22 changed files with 174 additions and 159 deletions

View File

@ -19,7 +19,9 @@ abstract class GaussianFactor extends Factor
parent::__construct($name);
}
/// Sends the factor-graph message with and returns the log-normalization constant
/**
* Sends the factor-graph message with and returns the log-normalization constant.
*/
protected function sendMessageVariable(Message &$message, Variable &$variable)
{
$marginal = &$variable->getValue();

View File

@ -1,21 +1,22 @@
<?php
namespace Moserware\Skills\TrueSkill\Factors;
require_once(dirname(__FILE__) . "/GaussianFactor.php");
require_once(dirname(__FILE__) . "/../TruncatedGaussianCorrectionFunctions.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Message.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Variable.php");
require_once(dirname(__FILE__) . "/../../Numerics/GaussianDistribution.php");
require_once(dirname(__FILE__) . "/../TruncatedGaussianCorrectionFunctions.php");
require_once(dirname(__FILE__) . "/GaussianFactor.php");
use Moserware\Numerics\GaussianDistribution;
use Moserware\Skills\TrueSkill\TruncatedGaussianCorrectionFunctions;
use Moserware\Skills\FactorGraphs\Message;
use Moserware\Skills\FactorGraphs\Variable;
/// <summary>
/// Factor representing a team difference that has exceeded the draw margin.
/// </summary>
/// <remarks>See the accompanying math paper for more details.</remarks>
/**
* Factor representing a team difference that has exceeded the draw margin.
*
* See the accompanying math paper for more details.
*/
class GaussianGreaterThanFactor extends GaussianFactor
{
private $_epsilon;
@ -72,12 +73,12 @@ class GaussianGreaterThanFactor extends GaussianFactor
GaussianDistribution::multiply($oldMessage, $newMarginal),
$oldMarginal);
/// Update the message and marginal
// Update the message and marginal
$message->setValue($newMessage);
$variable->setValue($newMarginal);
/// Return the difference in the new marginal
// Return the difference in the new marginal
return GaussianDistribution::subtract($newMarginal, $oldMarginal);
}
}

View File

@ -1,19 +1,20 @@
<?php
namespace Moserware\Skills\TrueSkill\Factors;
require_once(dirname(__FILE__) . "/GaussianFactor.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Message.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Variable.php");
require_once(dirname(__FILE__) . "/../../Numerics/GaussianDistribution.php");
require_once(dirname(__FILE__) . "/GaussianFactor.php");
use Moserware\Numerics\GaussianDistribution;
use Moserware\Skills\FactorGraphs\Message;
use Moserware\Skills\FactorGraphs\Variable;
/// <summary>
/// Connects two variables and adds uncertainty.
/// </summary>
/// <remarks>See the accompanying math paper for more details.</remarks>
/**
* Connects two variables and adds uncertainty.
*
* See the accompanying math paper for more details.
*/
class GaussianLikelihoodFactor extends GaussianFactor
{
private $_precision;
@ -55,12 +56,12 @@ class GaussianLikelihoodFactor extends GaussianFactor
$newMarginal = GaussianDistribution::multiply($oldMarginalWithoutMessage, $newMessage);
/// Update the message and marginal
// Update the message and marginal
$message1->setValue($newMessage);
$variable1->setValue($newMarginal);
/// Return the difference in the new marginal
// Return the difference in the new marginal
return GaussianDistribution::subtract($newMarginal, $marginal1);
}

View File

@ -1,20 +1,20 @@
<?php
namespace Moserware\Skills\TrueSkill\Factors;
require_once(dirname(__FILE__) . "/GaussianFactor.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Message.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Variable.php");
require_once(dirname(__FILE__) . "/../../Numerics/GaussianDistribution.php");
require_once(dirname(__FILE__) . "/GaussianFactor.php");
use Moserware\Numerics\GaussianDistribution;
use Moserware\Skills\FactorGraphs\Message;
use Moserware\Skills\FactorGraphs\Variable;
/// <summary>
/// Supplies the factor graph with prior information.
/// </summary>
/// <remarks>See the accompanying math paper for more details.</remarks>
/**
* Supplies the factor graph with prior information.
*
* See the accompanying math paper for more details.
*/
class GaussianPriorFactor extends GaussianFactor
{
private $_newMessage;

View File

@ -1,22 +1,23 @@
<?php
namespace Moserware\Skills\TrueSkill\Factors;
require_once(dirname(__FILE__) . "/GaussianFactor.php");
require_once(dirname(__FILE__) . "/../../Guard.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Message.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Variable.php");
require_once(dirname(__FILE__) . "/../../Numerics/GaussianDistribution.php");
require_once(dirname(__FILE__) . "/../../Numerics/BasicMath.php");
require_once(dirname(__FILE__) . "/GaussianFactor.php");
use Moserware\Numerics\GaussianDistribution;
use Moserware\Skills\Guard;
use Moserware\Skills\FactorGraphs\Message;
use Moserware\Skills\FactorGraphs\Variable;
/// <summary>
/// Factor that sums together multiple Gaussians.
/// </summary>
/// <remarks>See the accompanying math paper for more details.</remarks>
/**
* Factor that sums together multiple Gaussians.
*
* See the accompanying math paper for more details.s
*/
class GaussianWeightedSumFactor extends GaussianFactor
{
private $_variableIndexOrdersForWeights = array();
@ -189,12 +190,12 @@ class GaussianWeightedSumFactor extends GaussianFactor
$newMarginal = GaussianDistribution::multiply($oldMarginalWithoutMessage, $newMessage);
/// Update the message and marginal
// Update the message and marginal
$messages[0]->setValue($newMessage);
$variables[0]->setValue($newMarginal);
/// Return the difference in the new marginal
// Return the difference in the new marginal
$finalDiff = GaussianDistribution::subtract($newMarginal, $marginal0);
return $finalDiff;
}

View File

@ -1,21 +1,22 @@
<?php
namespace Moserware\Skills\TrueSkill\Factors;
require_once(dirname(__FILE__) . "/GaussianFactor.php");
require_once(dirname(__FILE__) . "/../TruncatedGaussianCorrectionFunctions.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Message.php");
require_once(dirname(__FILE__) . "/../../FactorGraphs/Variable.php");
require_once(dirname(__FILE__) . "/../../Numerics/GaussianDistribution.php");
require_once(dirname(__FILE__) . "/GaussianFactor.php");
use Moserware\Numerics\GaussianDistribution;
use Moserware\Skills\TrueSkill\TruncatedGaussianCorrectionFunctions;
use Moserware\Skills\FactorGraphs\Message;
use Moserware\Skills\FactorGraphs\Variable;
/// <summary>
/// Factor representing a team difference that has not exceeded the draw margin.
/// </summary>
/// <remarks>See the accompanying math paper for more details.</remarks>
/**
* Factor representing a team difference that has not exceeded the draw margin.
*
* See the accompanying math paper for more details.
*/
class GaussianWithinFactor extends GaussianFactor
{
private $_epsilon;
@ -71,11 +72,11 @@ class GaussianWithinFactor extends GaussianFactor
GaussianDistribution::multiply($oldMessage, $newMarginal),
$oldMarginal);
/// Update the message and marginal
// Update the message and marginal
$message->setValue($newMessage);
$variable->setValue($newMarginal);
/// Return the difference in the new marginal
// Return the difference in the new marginal
return GaussianDistribution::subtract($newMarginal, $oldMarginal);
}
}