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_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 | } |
---|