mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-15 02:24:28 +00:00
28 lines
608 B
PHP
28 lines
608 B
PHP
<?php
|
|
|
|
namespace DNW\Skills\FactorGraphs;
|
|
|
|
class ScheduleSequence extends Schedule
|
|
{
|
|
private $_schedules;
|
|
|
|
public function __construct($name, array $schedules)
|
|
{
|
|
parent::__construct($name);
|
|
$this->_schedules = $schedules;
|
|
}
|
|
|
|
public function visit($depth = -1, $maxDepth = 0)
|
|
{
|
|
$maxDelta = 0;
|
|
|
|
$schedules = $this->_schedules;
|
|
foreach ($schedules as $currentSchedule) {
|
|
$currentVisit = $currentSchedule->visit($depth + 1, $maxDepth);
|
|
$maxDelta = max($currentVisit, $maxDelta);
|
|
}
|
|
|
|
return $maxDelta;
|
|
}
|
|
}
|