source: src/main/java/negotiator/boaframework/acceptanceconditions/anac2010/AC_IAMHaggler2010.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.3 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_IAMHaggler2010 extends AcceptanceStrategy {
23
24 private double maximum_aspiration = 0.9;
25 private final double acceptMultiplier = 1.02;
26
27 /**
28 * Empty constructor for the BOA framework.
29 */
30 public AC_IAMHaggler2010() {
31 }
32
33 public AC_IAMHaggler2010(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
44 @Override
45 public Actions determineAcceptability() {
46 if (negotiationSession.getOpponentBidHistory() != null
47 && negotiationSession.getOwnBidHistory().getLastBidDetails() != null) {
48 double lastOpponentBidUtil = negotiationSession.getOpponentBidHistory().getLastBidDetails()
49 .getMyUndiscountedUtil();
50 double lastMyBidUtil = negotiationSession.getOwnBidHistory().getLastBidDetails().getMyUndiscountedUtil();
51 // accept if the offered utility => 0.98 * previous offer OR
52 // accept if the offered utility => 0.98 * nextBid OR
53 // accept if the offered utility => 0.98 * maxUtility
54 if (lastOpponentBidUtil * acceptMultiplier >= lastMyBidUtil
55 || lastOpponentBidUtil * acceptMultiplier >= offeringStrategy.getNextBid().getMyUndiscountedUtil()
56 || lastOpponentBidUtil * acceptMultiplier >= maximum_aspiration) {
57 return Actions.Accept;
58 }
59 }
60 return Actions.Reject;
61 }
62
63 @Override
64 public String getName() {
65 return "2010 - IAMHaggler";
66 }
67}
Note: See TracBrowser for help on using the repository browser.