1 | package agents.anac.y2012.IAMhaggler2012;
|
---|
2 |
|
---|
3 | import agents.anac.y2012.IAMhaggler2012.agents2011.IAMhaggler2011;
|
---|
4 | import agents.anac.y2012.IAMhaggler2012.utility.SouthamptonUtilitySpace;
|
---|
5 | import genius.core.Bid;
|
---|
6 | import genius.core.SupportedNegotiationSetting;
|
---|
7 | import genius.core.utility.AdditiveUtilitySpace;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * @author Colin Williams
|
---|
11 | *
|
---|
12 | * The IAMhaggler Agent, created for ANAC 2012. Designed by C. R.
|
---|
13 | * Williams, V. Robu, E. H. Gerding and N. R. Jennings.
|
---|
14 | *
|
---|
15 | */
|
---|
16 | public class IAMhaggler2012 extends IAMhaggler2011 {
|
---|
17 |
|
---|
18 | private SouthamptonUtilitySpace sus;
|
---|
19 |
|
---|
20 | /*
|
---|
21 | * (non-Javadoc)
|
---|
22 | *
|
---|
23 | * @see agents.southampton.SouthamptonAgent#init()
|
---|
24 | */
|
---|
25 | @Override
|
---|
26 | public void init() {
|
---|
27 | debug = false;
|
---|
28 | super.init();
|
---|
29 | sus = new SouthamptonUtilitySpace((AdditiveUtilitySpace) utilitySpace);
|
---|
30 | }
|
---|
31 |
|
---|
32 | /*
|
---|
33 | *
|
---|
34 | * (non-Javadoc)
|
---|
35 | *
|
---|
36 | * @see agents2011.southampton.IAMhaggler2011#proposeInitialBid()
|
---|
37 | */
|
---|
38 | @Override
|
---|
39 | protected Bid proposeInitialBid() throws Exception {
|
---|
40 | Bid b = sus.getMaxUtilityBid();
|
---|
41 | if (utilitySpace.getUtilityWithDiscount(b, timeline) < utilitySpace
|
---|
42 | .getReservationValueWithDiscount(timeline)) {
|
---|
43 | return null;
|
---|
44 | }
|
---|
45 | return b;
|
---|
46 | }
|
---|
47 |
|
---|
48 | /*
|
---|
49 | * (non-Javadoc)
|
---|
50 | *
|
---|
51 | * @see agents.southampton.SouthamptonAgent#proposeNextBid(negotiator.Bid)
|
---|
52 | */
|
---|
53 | @Override
|
---|
54 | protected Bid proposeNextBid(Bid opponentBid) throws Exception {
|
---|
55 | Bid b = super.proposeNextBid(opponentBid);
|
---|
56 | if (utilitySpace.getUtilityWithDiscount(b, timeline) < utilitySpace
|
---|
57 | .getReservationValueWithDiscount(timeline)) {
|
---|
58 | return proposeInitialBid();
|
---|
59 | }
|
---|
60 | return b;
|
---|
61 | }
|
---|
62 |
|
---|
63 | /*
|
---|
64 | * (non-Javadoc)
|
---|
65 | *
|
---|
66 | * @see agents2011.southampton.IAMhaggler2011#getTarget(double, double)
|
---|
67 | */
|
---|
68 | @Override
|
---|
69 | protected double getTarget(double opponentUtility, double time) {
|
---|
70 | return Math.max(utilitySpace.getReservationValueWithDiscount(time),
|
---|
71 | super.getTarget(opponentUtility, time));
|
---|
72 | }
|
---|
73 |
|
---|
74 | @Override
|
---|
75 | public SupportedNegotiationSetting getSupportedNegotiationSetting() {
|
---|
76 | return SupportedNegotiationSetting.getLinearUtilitySpaceInstance();
|
---|
77 | }
|
---|
78 |
|
---|
79 | @Override
|
---|
80 | public String getDescription() {
|
---|
81 | return "ANAC2012";
|
---|
82 | }
|
---|
83 | }
|
---|