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

Last change on this file since 126 was 126, checked in by Aron Hammond, 6 years ago

Added function to calculate opposition to MultiLateralAnalysis.java

Moved code to add RLBOA listeners to RLBOAUtils is misc package

Added input for strategyParameters to SessionPanel (gui)

!! close SessionInfo after tournament; this caused /tmp/ to fill up with GeniusData files

Our own package:

  • Added opponents and strategies that are mentioned in the report
  • Change class hierarchy, agents can now extend from RLBOAagentBilateral to inherit RL functionality.
  • States extend from AbstractState
File size: 1.5 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.