source: opponentmodel/src/main/java/geniusweb/opponentmodel/bayesian/EvaluatorHypothesis.java@ 52

Last change on this file since 52 was 52, checked in by ruud, 14 months ago

Fixed small issues in domaineditor.

File size: 1.3 KB
Line 
1package geniusweb.opponentmodel.bayesian;
2
3import geniusweb.profile.utilityspace.ValueSetUtilities;
4
5/**
6 * EXPERIMENTAL. DO NOT USE THIS.
7 *
8 */
9class EvaluatorHypothesis extends Hypothesis {
10 @Override
11 public int hashCode() {
12 final int prime = 31;
13 int result = super.hashCode();
14 result = prime * result + ((utils == null) ? 0 : utils.hashCode());
15 return result;
16 }
17
18 @Override
19 public boolean equals(Object obj) {
20 if (this == obj)
21 return true;
22 if (!super.equals(obj))
23 return false;
24 if (getClass() != obj.getClass())
25 return false;
26 EvaluatorHypothesis other = (EvaluatorHypothesis) obj;
27 if (utils == null) {
28 if (other.utils != null)
29 return false;
30 } else if (!utils.equals(other.utils))
31 return false;
32 return true;
33 }
34
35 private final ValueSetUtilities utils;
36
37 /**
38 *
39 * @param pEval the ValueSetUtilities utility function
40 */
41 public EvaluatorHypothesis(ValueSetUtilities pEval, double p) {
42 super(p);
43 utils = pEval;
44 }
45
46 public ValueSetUtilities getEvaluator() {
47 return utils;
48 }
49
50 @Override
51 public EvaluatorHypothesis with(double p) {
52 return new EvaluatorHypothesis(utils, p);
53 }
54
55 @Override
56 public String toString() {
57 return "P(" + utils + ")=" + getProbability();
58 }
59
60}
Note: See TracBrowser for help on using the repository browser.