source: src/main/java/agents/anac/y2010/AgentFSEGA/UtilitySpaceHypothesis.java@ 345

Last change on this file since 345 was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 1.6 KB
Line 
1package agents.anac.y2010.AgentFSEGA;
2
3import java.util.List;
4
5import genius.core.Bid;
6import genius.core.Domain;
7import genius.core.issue.Issue;
8import genius.core.utility.AdditiveUtilitySpace;
9
10public class UtilitySpaceHypothesis extends Hypothesis {
11 private Domain dDomain;
12 private AdditiveUtilitySpace dUS;
13 private WeightHypothesis dWeightHyp;
14 private EvaluatorHypothesis[] eEvalHyp;
15 List<Issue> issues;
16
17 public UtilitySpaceHypothesis(Domain pDomain, AdditiveUtilitySpace pUS,
18 WeightHypothesis pWeightHyp, EvaluatorHypothesis[] pEvalHyp) {
19 dUS = pUS;
20 dDomain = pDomain;
21 issues = dDomain.getIssues();
22 dWeightHyp = pWeightHyp;
23 eEvalHyp = pEvalHyp;
24 }
25
26 public Domain getDomain() {
27 return dDomain;
28 }
29
30 public EvaluatorHypothesis[] getEvalHyp() {
31 return eEvalHyp;
32 }
33
34 public WeightHypothesis getHeightHyp() {
35 return dWeightHyp;
36 }
37
38 public double getUtility(Bid pBid) {
39 double u = 0;
40
41 for (int k = 0; k < eEvalHyp.length; k++) {
42 try {
43 // utility = sum( weight * isue_evaluation)
44 u = u
45 + dWeightHyp.getWeight(k)
46 * eEvalHyp[k].getEvaluator().getEvaluation(dUS, pBid,
47 issues.get(k).getNumber());
48 } catch (Exception e) {
49 u = 0;
50 }
51 }
52 return u;
53
54 }
55
56 public String toString() {
57 String lResult = "UtilitySpaceHypotesis[";
58 lResult += dWeightHyp.toString() + ", EvaluatorHypotesis[";
59 for (EvaluatorHypothesis lHyp : eEvalHyp) {
60 lResult += lHyp.toString() + "; ";
61 }
62 lResult += String.format("], %1.5f]", getProbability());
63 return lResult;
64 }
65}
Note: See TracBrowser for help on using the repository browser.