source: src/main/java/agents/anac/y2010/Southampton/IAMhaggler.java@ 126

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

Initial import : Genius 9.0.0

File size: 3.1 KB
Line 
1package agents.anac.y2010.Southampton;
2
3import agents.anac.y2010.Southampton.similarity.LinearSimilarityAgent;
4import agents.anac.y2010.Southampton.utils.concession.SpecialTimeConcessionFunction;
5import agents.anac.y2010.Southampton.utils.concession.TimeConcessionFunction;
6import genius.core.SupportedNegotiationSetting;
7
8/**
9 * @author Colin Williams The IAMhaggler Agent, created for ANAC 2010. Designed
10 * by C. R. Williams, V. Robu, E. Gerding and N. R. Jennings.
11 *
12 */
13public class IAMhaggler extends LinearSimilarityAgent {
14
15 /**
16 * The lowest target we have tried to use (initialised to 1).
17 */
18 private double lowestTarget = 1.0;
19
20 /**
21 * The minimum discounting factor.
22 */
23 private final double minDiscounting = 0.1;
24
25 /**
26 * The minimum beta value, which stops the agent from becoming too tough.
27 */
28 private final double minBeta = 0.01;
29
30 /**
31 * The maximum beta value, which stops the agent from becoming too weak.
32 */
33 private double maxBeta = 2.0;
34
35 /**
36 * The default value for beta, used when there is not enough information to
37 * perform the linear regression.
38 */
39 private double defaultBeta = 1;
40
41 /**
42 * The minimum target value when the opponent is considered to be a
43 * hardhaed.
44 */
45 private final double hardHeadTarget = 0.8;
46
47 /*
48 * (non-Javadoc)
49 *
50 * @see agents.southampton.similarity.SimilarityAgent#init()
51 */
52 @Override
53 public void init() {
54 super.init();
55 int discreteCombinationCount = this.bidSpace
56 .getDiscreteCombinationsCount();
57 if (this.bidSpace.isContinuousWeightsZero()) {
58 defaultBeta = Math.min(0.5,
59 Math.max(0.0625, discreteCombinationCount * 0.001));
60 if (utilitySpace.isDiscounted()) {
61 maxBeta = (2.0 + (4.0
62 * Math.min(0.5, utilitySpace.getDiscountFactor())))
63 * defaultBeta;
64 } else {
65 maxBeta = 2.0 + 4.0 * defaultBeta;
66 }
67 }
68 }
69
70 /*
71 * (non-Javadoc)
72 *
73 * @see agents.southampton.similarity.VariableConcessionSimilarityAgent#
74 * getTargetUtility(double, double)
75 */
76 @Override
77 protected double getTargetUtility(double myUtility, double oppntUtility) {
78 double currentTime = timeline.getTime() * timeline.getTotalTime()
79 * 1000;
80 double beta = bidSpace.getBeta(bestOpponentBidUtilityHistory,
81 timeline.getTime(), utility0, utility1, minDiscounting, minBeta,
82 maxBeta, defaultBeta, currentTime, currentTime);
83
84 cf = new SpecialTimeConcessionFunction(beta, defaultBeta,
85 TimeConcessionFunction.DEFAULT_BREAKOFF);
86
87 double target = super.getTargetUtility(myUtility, oppntUtility);
88
89 lowestTarget = Math.min(target, lowestTarget);
90
91 if (opponentIsHardHead) {
92 return Math.max(hardHeadTarget, lowestTarget);
93 }
94 return lowestTarget;
95 }
96
97 /*
98 * (non-Javadoc)
99 *
100 * @see negotiator.Agent#getName()
101 */
102 @Override
103 public String getName() {
104 return "IAMhaggler";
105 }
106
107 /**
108 * @return
109 */
110 @Override
111 public String getVersion() {
112 return "2.0 (Genius 3.1)";
113 }
114
115 @Override
116 public SupportedNegotiationSetting getSupportedNegotiationSetting() {
117 return SupportedNegotiationSetting.getLinearUtilitySpaceInstance();
118 }
119
120 @Override
121 public String getDescription() {
122 return "ANAC2010";
123 }
124}
Note: See TracBrowser for help on using the repository browser.