source: src/main/java/agents/anac/y2010/Southampton/IAMcrazyHaggler.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.5 KB
RevLine 
[1]1package agents.anac.y2010.Southampton;
2
3import java.util.Random;
4
5import genius.core.Bid;
6import genius.core.SupportedNegotiationSetting;
7
8/**
9 * @author Colin Williams
10 *
11 */
12public class IAMcrazyHaggler extends SouthamptonAgent {
13
14 private double breakOff = 0.9;// 0.93;
15 private final boolean TEST_EQUIVALENCE = false;
16 private Random random100;
17
18 @Override
19 public void init() {
20 super.init();
21 MAXIMUM_ASPIRATION = 0.85;// 93;
22 if (this.utilitySpace.isDiscounted()) {
23 MAXIMUM_ASPIRATION = 0.9;
24 breakOff = 0.95;
25 }
26 if (TEST_EQUIVALENCE) {
27 random100 = new Random(100);
28 } else {
29 random100 = new Random();
30 }
31 }
32
33 /*
34 * (non-Javadoc)
35 *
36 * @see negotiator.Agent#getName()
37 */
38 @Override
39 public String getName() {
40 return "IAMcrazyHaggler";
41 }
42
43 @Override
44 protected Bid proposeInitialBid() throws Exception {
45 return proposeRandomBid();
46 }
47
48 @Override
49 protected Bid proposeNextBid(Bid opponentBid) throws Exception {
50 return proposeRandomBid();
51 }
52
53 private Bid proposeRandomBid() {
54 Bid bid = null;
55 try {
56 do {
57 bid = this.utilitySpace.getDomain().getRandomBid(random100);
58 } while (this.utilitySpace.getUtility(bid) <= breakOff);
59 } catch (Exception e) {
60 e.printStackTrace();
61 }
62 return bid;
63 }
64
65 /**
66 * @return
67 */
68 @Override
69 public String getVersion() {
70 return "2.0 (Genius 3.1)";
71 }
72
73 @Override
74 public SupportedNegotiationSetting getSupportedNegotiationSetting() {
75 return SupportedNegotiationSetting.getLinearUtilitySpaceInstance();
76 }
77
78 @Override
79 public String getDescription() {
80 return "ANAC2010";
81 }
82}
Note: See TracBrowser for help on using the repository browser.