| 1 | <?php |
||
| 10 | class AlphaBeta |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var float |
||
| 14 | */ |
||
| 15 | public $alpha; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var float |
||
| 19 | */ |
||
| 20 | public $beta; |
||
| 21 | |||
| 22 | 14 | public function __construct(float $alpha, float $beta) |
|
| 27 | |||
| 28 | 14 | public static function initial(): AlphaBeta |
|
| 32 | |||
| 33 | /** |
||
| 34 | * Update the constraint with new information |
||
| 35 | */ |
||
| 36 | 13 | public function update(Evaluation $evaluation, NodeType $nodeType): void |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Check whether the value ranges (alpha..inf and -inf..beta) still overlap |
||
| 47 | * If not, the conclusion is that the game tree branch can be pruned. |
||
| 48 | */ |
||
| 49 | 13 | public function isPositiveRange(): bool |
|
| 53 | } |
||
| 54 |