1 | package negotiator.boaframework.acceptanceconditions.anac2010;
|
---|
2 |
|
---|
3 | import java.util.Map;
|
---|
4 |
|
---|
5 | import genius.core.boaframework.AcceptanceStrategy;
|
---|
6 | import genius.core.boaframework.Actions;
|
---|
7 | import genius.core.boaframework.NegotiationSession;
|
---|
8 | import genius.core.boaframework.OfferingStrategy;
|
---|
9 | import 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 | */
|
---|
22 | public 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 | }
|
---|