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