source: src/main/java/negotiator/boaframework/acceptanceconditions/anac2010/AC_IAMcrazyHaggler.java

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

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 2.4 KB
Line 
1package negotiator.boaframework.acceptanceconditions.anac2010;
2
3import java.util.Map;
4
5import genius.core.boaframework.AcceptanceStrategy;
6import genius.core.boaframework.Actions;
7import genius.core.boaframework.NegotiationSession;
8import genius.core.boaframework.OfferingStrategy;
9import genius.core.boaframework.OpponentModel;
10
11/**
12 * This is the decoupled Acceptance Conditions for IAMcrazyHaggler (ANAC2010).
13 * The code was taken from the ANAC2010 IAMHaggler and adapted to work within
14 * the BOA framework.
15 *
16 * Decoupling Negotiating Agents to Explore the Space of Negotiation Strategies
17 * T. Baarslag, K. Hindriks, M. Hendrikx, A. Dirkzwager, C.M. Jonker
18 *
19 * @author Alex Dirkzwager, Mark Hendrikx
20 * @version 18/12/11
21 */
22public class AC_IAMcrazyHaggler extends AcceptanceStrategy {
23
24 private double maximum_aspiration = 0.85;
25 private final double acceptMultiplier = 1.02;
26
27 /**
28 * Empty constructor for the BOA framework.
29 */
30 public AC_IAMcrazyHaggler() {
31 }
32
33 public AC_IAMcrazyHaggler(NegotiationSession negoSession, OfferingStrategy strat) throws Exception {
34 init(negoSession, strat, null, null);
35 }
36
37 @Override
38 public void init(NegotiationSession negoSession, OfferingStrategy strat, OpponentModel opponentModel,
39 Map<String, Double> parameters) throws Exception {
40 this.negotiationSession = negoSession;
41 offeringStrategy = strat;
42
43 if (negotiationSession.getDiscountFactor() == 0) {
44 maximum_aspiration = 0.9;
45 }
46 }
47
48 @Override
49 public Actions determineAcceptability() {
50 if (negotiationSession.getOpponentBidHistory() != null
51 && negotiationSession.getOwnBidHistory().getLastBidDetails() != null) {
52 double lastOpponentBidUtil = negotiationSession.getOpponentBidHistory().getLastBidDetails()
53 .getMyUndiscountedUtil();
54 double lastMyBidUtil = negotiationSession.getOwnBidHistory().getLastBidDetails().getMyUndiscountedUtil();
55 // accept if the offered utility => 0.98 * previous offer OR
56 // accept if the offered utility => 0.98 * nextBid OR
57 // accept if the offered utility => 0.98 * maxUtility
58 if (lastOpponentBidUtil * acceptMultiplier > lastMyBidUtil
59 || lastOpponentBidUtil * acceptMultiplier > offeringStrategy.getNextBid().getMyUndiscountedUtil()
60 || lastOpponentBidUtil * acceptMultiplier > maximum_aspiration) {
61 return Actions.Accept;
62 }
63 }
64 return Actions.Reject;
65 }
66
67 @Override
68 public String getName() {
69 return "2010 - IAMcrazyHaggler";
70 }
71}
Note: See TracBrowser for help on using the repository browser.