mirror of
https://github.com/furyfire/trueskill.git
synced 2025-01-16 01:47:39 +00:00
Now it throws an error, but at least it runs something
This commit is contained in:
@ -44,7 +44,7 @@ abstract class FactorGraphLayer
|
||||
|
||||
protected function scheduleSequence($itemsToSequence)
|
||||
{
|
||||
return new ScheduleSequence($itemsToSequence);
|
||||
return new ScheduleSequence("TODO", $itemsToSequence);
|
||||
}
|
||||
|
||||
protected function addLayerFactor($factor)
|
||||
|
@ -6,7 +6,9 @@ require_once(dirname(__FILE__) . '/RatingContainer.php');
|
||||
class Team extends RatingContainer
|
||||
{
|
||||
public function __construct($player = null, $rating = null)
|
||||
{
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if(!\is_null($player))
|
||||
{
|
||||
$this->addPlayer($player, $rating);
|
||||
|
@ -29,11 +29,11 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer
|
||||
|
||||
public function buildLayer()
|
||||
{
|
||||
$this->_TeamPerformancesToTeamPerformanceDifferencesLayer->setRawInputVariablesGroups($this->getInputVariablesGroups());
|
||||
$this->_TeamPerformancesToTeamPerformanceDifferencesLayer->setInputVariablesGroups($this->getInputVariablesGroups());
|
||||
$this->_TeamPerformancesToTeamPerformanceDifferencesLayer->buildLayer();
|
||||
|
||||
$this->_TeamDifferencesComparisonLayer->setRawInputVariablesGroups(
|
||||
$this->_TeamPerformancesToTeamPerformanceDifferencesLayer->getRawOutputVariablesGroups());
|
||||
$this->_TeamDifferencesComparisonLayer->setInputVariablesGroups(
|
||||
$this->_TeamPerformancesToTeamPerformanceDifferencesLayer->getOutputVariablesGroups());
|
||||
$this->_TeamDifferencesComparisonLayer->buildLayer();
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,8 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
|
||||
$this->addLayerFactor($this->createPlayerToTeamSumFactor($currentTeam, $teamPerformance));
|
||||
|
||||
// REVIEW: Does it make sense to have groups of one?
|
||||
$this->getOutputVariablesGroups() = $teamPerformance;
|
||||
$outputVariablesGroups = $this->getOutputVariablesGroups();
|
||||
$outputVariablesGroups = $teamPerformance;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,10 @@
|
||||
namespace Moserware\Skills\TrueSkill\Layers;
|
||||
|
||||
require_once(dirname(__FILE__) . "/../../FactorGraphs/FactorGraphLayer.php");
|
||||
require_once(dirname(__FILE__) . "/../TrueSkillFactorGraph.php");
|
||||
|
||||
use Moserware\Skills\FactorGraphs\FactorGraphLayer;
|
||||
use Moserware\Skills\TrueSkill\TrueSkillFactorGraph;
|
||||
|
||||
abstract class TrueSkillFactorGraphLayer extends FactorGraphLayer
|
||||
{
|
||||
|
@ -1,28 +1,32 @@
|
||||
<?php
|
||||
namespace Moserware\Skills\TrueSkill;
|
||||
|
||||
require_once(dirname(__FILE__) . '/../GameInfo.php');
|
||||
require_once(dirname(__FILE__) . '/../Rating.php');
|
||||
require_once(dirname(__FILE__) . '/../FactorGraphs/FactorGraph.php');
|
||||
require_once(dirname(__FILE__) . '/../FactorGraphs/FactorList.php');
|
||||
require_once(dirname(__FILE__) . '/../FactorGraphs/Schedule.php');
|
||||
require_once(dirname(__FILE__) . '/../FactorGraphs/VariableFactory.php');
|
||||
require_once(dirname(__FILE__) . '/../Numerics/GaussianDistribution.php');
|
||||
require_once(dirname(__FILE__) . '/Layers/IteratedTeamDifferencesInnerLayer.php');
|
||||
require_once(dirname(__FILE__) . '/Layers/PlayerPerformancesToTeamPerformancesLayer.php');
|
||||
require_once(dirname(__FILE__) . '/Layers/PlayerPriorValuesToSkillsLayer.php');
|
||||
require_once(dirname(__FILE__) . '/Layers/PlayerSkillsToPerformancesLayer.php');
|
||||
require_once(dirname(__FILE__) . '/Layers/IteratedTeamDifferencesInnerLayer.php');
|
||||
require_once(dirname(__FILE__) . '/Layers/TeamPerformancesToTeamPerformanceDifferencesLayer.php');
|
||||
require_once(dirname(__FILE__) . '/Layers/TeamDifferencesComparisonLayer.php');
|
||||
require_once(dirname(__FILE__) . '/Layers/TeamPerformancesToTeamPerformanceDifferencesLayer.php');
|
||||
|
||||
use Moserware\Skills\GameInfo;
|
||||
use Moserware\Skills\Rating;
|
||||
use Moserware\Skills\FactorGraphs\FactorGraph;
|
||||
use Moserware\Skills\FactorGraphs\FactorList;
|
||||
use Moserware\Skills\FactorGraphs\ScheduleSequence;
|
||||
use Moserware\Skills\FactorGraphs\VariableFactory;
|
||||
use Moserware\Skills\TrueSkill\Layers\IteratedTeamDifferencesInnerLayer;
|
||||
use Moserware\Skills\TrueSkill\Layers\PlayerPerformancesToTeamPerformancesLayer;
|
||||
use Moserware\Skills\TrueSkill\Layers\PlayerPriorValuesToSkillsLayer;
|
||||
use Moserware\Skills\TrueSkill\Layers\PlayerSkillsToPerformancesLayer;
|
||||
use Moserware\Skills\TrueSkill\Layers\IteratedTeamDifferencesInnerLayer;
|
||||
use Moserware\Skills\TrueSkill\Layers\TeamPerformancesToTeamPerformanceDifferencesLayer;
|
||||
use Moserware\Skills\TrueSkill\Layers\TeamDifferencesComparisonLayer;
|
||||
use Moserware\Skills\TrueSkill\Layers\TeamPerformancesToTeamPerformanceDifferencesLayer;
|
||||
|
||||
class TrueSkillFactorGraph extends FactorGraph
|
||||
{
|
||||
@ -105,7 +109,7 @@ class TrueSkillFactorGraph extends FactorGraph
|
||||
$currentPriorSchedule = $currentLayer->createPriorSchedule();
|
||||
if ($currentPriorSchedule != null)
|
||||
{
|
||||
$fullSchedule->add($currentPriorSchedule);
|
||||
$fullSchedule[] = $currentPriorSchedule;
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +120,7 @@ class TrueSkillFactorGraph extends FactorGraph
|
||||
$currentPosteriorSchedule = $currentLayer->createPosteriorSchedule();
|
||||
if ($currentPosteriorSchedule != null)
|
||||
{
|
||||
$fullSchedule->add($currentPosteriorSchedule);
|
||||
$fullSchedule[] = $currentPosteriorSchedule;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user