| 1 | <?php |
||
| 14 | class Evaluation |
||
| 15 | { |
||
| 16 | private const EPSILON = 0.00001; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var float Score that results from applying the decision |
||
| 20 | */ |
||
| 21 | public $score; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var integer How deep in the execution tree this result was found. Higher |
||
| 25 | * means earlier. This is to prefer earlier solutions to later solutions |
||
| 26 | * with the same score, which will make the AI not delay a win without |
||
| 27 | * reason. |
||
| 28 | */ |
||
| 29 | public $age; |
||
| 30 | |||
| 31 | 12 | public function isBetterThan(Evaluation $other): bool |
|
| 39 | |||
| 40 | 12 | public static function getBestComparator(): Closure |
|
| 46 | |||
| 47 | 11 | public static function getWorstComparator(): Closure |
|
| 53 | } |
||
| 54 |