|
1 | 1 | package cloud.eppo;
|
2 | 2 |
|
| 3 | +import java.util.Objects; |
| 4 | + |
3 | 5 | import cloud.eppo.api.DiscriminableAttributes;
|
4 | 6 |
|
5 | 7 | public class BanditEvaluationResult {
|
@@ -35,6 +37,40 @@ public BanditEvaluationResult(
|
35 | 37 | this.optimalityGap = optimalityGap;
|
36 | 38 | }
|
37 | 39 |
|
| 40 | + @Override |
| 41 | + public String toString() { |
| 42 | + return "BanditEvaluationResult{" + |
| 43 | + "flagKey='" + flagKey + '\'' + |
| 44 | + ", subjectKey='" + subjectKey + '\'' + |
| 45 | + ", subjectAttributes=" + subjectAttributes + |
| 46 | + ", actionKey='" + actionKey + '\'' + |
| 47 | + ", actionAttributes=" + actionAttributes + |
| 48 | + ", actionScore=" + actionScore + |
| 49 | + ", actionWeight=" + actionWeight + |
| 50 | + ", gamma=" + gamma + |
| 51 | + ", optimalityGap=" + optimalityGap + |
| 52 | + '}'; |
| 53 | + } |
| 54 | + |
| 55 | + @Override |
| 56 | + public boolean equals(Object o) { |
| 57 | + if (o == null || getClass() != o.getClass()) return false; |
| 58 | + BanditEvaluationResult that = (BanditEvaluationResult) o; |
| 59 | + return Double.compare(actionScore, that.actionScore) == 0 |
| 60 | + && Double.compare(actionWeight, that.actionWeight) == 0 |
| 61 | + && Double.compare(gamma, that.gamma) == 0 |
| 62 | + && Double.compare(optimalityGap, that.optimalityGap) == 0 |
| 63 | + && Objects.equals(flagKey, that.flagKey) |
| 64 | + && Objects.equals(subjectKey, that.subjectKey) |
| 65 | + && Objects.equals(subjectAttributes, that.subjectAttributes) |
| 66 | + && Objects.equals(actionKey, that.actionKey) && Objects.equals(actionAttributes, that.actionAttributes); |
| 67 | + } |
| 68 | + |
| 69 | + @Override |
| 70 | + public int hashCode() { |
| 71 | + return Objects.hash(flagKey, subjectKey, subjectAttributes, actionKey, actionAttributes, actionScore, actionWeight, gamma, optimalityGap); |
| 72 | + } |
| 73 | + |
38 | 74 | public String getFlagKey() {
|
39 | 75 | return flagKey;
|
40 | 76 | }
|
|
0 commit comments