source: src/main/java/agents/anac/y2013/MetaAgent/portfolio/IAMhaggler2012/IAMhaggler2012.java

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

Initial import : Genius 9.0.0

File size: 1.9 KB
Line 
1package agents.anac.y2013.MetaAgent.portfolio.IAMhaggler2012;
2
3import agents.anac.y2013.MetaAgent.portfolio.IAMhaggler2012.agents2011.IAMhaggler2011;
4import agents.anac.y2013.MetaAgent.portfolio.IAMhaggler2012.utility.SouthamptonUtilitySpace;
5import genius.core.Bid;
6import genius.core.utility.AdditiveUtilitySpace;
7
8/**
9 * @author Colin Williams
10 *
11 * The IAMhaggler Agent, created for ANAC 2012. Designed by C. R.
12 * Williams, V. Robu, E. H. Gerding and N. R. Jennings.
13 *
14 */
15public class IAMhaggler2012 extends IAMhaggler2011 {
16
17 private SouthamptonUtilitySpace sus;
18
19 /*
20 * (non-Javadoc)
21 *
22 * @see agents.southampton.SouthamptonAgent#init()
23 */
24 @Override
25 public void init() {
26 debug = false;
27 super.init();
28 sus = new agents.anac.y2013.MetaAgent.portfolio.IAMhaggler2012.utility.SouthamptonUtilitySpace(
29 (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}
Note: See TracBrowser for help on using the repository browser.