1 | <?php |
||
19 | final class Score |
||
20 | { |
||
21 | private $scaled; |
||
22 | private $raw; |
||
23 | private $min; |
||
24 | private $max; |
||
25 | |||
26 | /** |
||
27 | * @param float|int|null $scaled |
||
28 | * @param float|int|null $raw |
||
29 | * @param float|int|null $min |
||
30 | * @param float|int|null $max |
||
31 | */ |
||
32 | public function __construct($scaled = null, $raw = null, $min = null, $max = null) |
||
39 | |||
40 | /** |
||
41 | * @param float|int|null $scaled |
||
42 | */ |
||
43 | public function withScaled($scaled): self |
||
50 | |||
51 | /** |
||
52 | * @param float|int|null $raw |
||
53 | */ |
||
54 | public function withRaw($raw): self |
||
61 | |||
62 | /** |
||
63 | * @param float|int|null $min |
||
64 | */ |
||
65 | public function withMin($min): self |
||
72 | |||
73 | /** |
||
74 | * @param float|int|null $max |
||
75 | */ |
||
76 | public function withMax($max): self |
||
83 | |||
84 | /** |
||
85 | * Returns the Agent's scaled score (a number between -1 and 1). |
||
86 | * |
||
87 | * @return float|int|null The scaled score |
||
88 | */ |
||
89 | public function getScaled() |
||
93 | |||
94 | /** |
||
95 | * Returns the Agent's score (a number between min and max). |
||
96 | * |
||
97 | * @return float|int|null The score |
||
98 | */ |
||
99 | public function getRaw() |
||
103 | |||
104 | /** |
||
105 | * Returns the lowest possible score. |
||
106 | * |
||
107 | * @return float|int|null The lowest possible score |
||
108 | */ |
||
109 | public function getMin() |
||
113 | |||
114 | /** |
||
115 | * Returns the highest possible score. |
||
116 | * |
||
117 | * @return float|int|null The highest possible score |
||
118 | */ |
||
119 | public function getMax() |
||
123 | |||
124 | /** |
||
125 | * Checks if another score is equal. |
||
126 | * |
||
127 | * Two scores are equal if and only if all of their properties are equal. |
||
128 | */ |
||
129 | public function equals(Score $score): bool |
||
165 | } |
||
166 |