1 | package negotiator.boaframework.acceptanceconditions.anac2011;
|
---|
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 IAMHaggler (ANAC2011). The
|
---|
13 | * code was taken from the ANAC2011 IAMHaggler and adapted to work within the
|
---|
14 | * 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 |
|
---|
23 | public class AC_IAMHaggler2011 extends AcceptanceStrategy {
|
---|
24 |
|
---|
25 | private double maximum_aspiration = 0.9;
|
---|
26 | private final double acceptMultiplier = 1.02;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Empty constructor for the BOA framework.
|
---|
30 | */
|
---|
31 | public AC_IAMHaggler2011() {
|
---|
32 | }
|
---|
33 |
|
---|
34 | public AC_IAMHaggler2011(NegotiationSession negoSession, OfferingStrategy strat) throws Exception {
|
---|
35 | init(negoSession, strat, null, null);
|
---|
36 | }
|
---|
37 |
|
---|
38 | @Override
|
---|
39 | public void init(NegotiationSession negoSession, OfferingStrategy strat, OpponentModel opponentModel,
|
---|
40 | Map<String, Double> parameters) throws Exception {
|
---|
41 | this.negotiationSession = negoSession;
|
---|
42 | offeringStrategy = strat;
|
---|
43 | }
|
---|
44 |
|
---|
45 | @Override
|
---|
46 | public Actions determineAcceptability() {
|
---|
47 | if (negotiationSession.getOpponentBidHistory() != null
|
---|
48 | && negotiationSession.getOwnBidHistory().getLastBidDetails() != null) {
|
---|
49 | double lastOpponentBidUtil = negotiationSession.getOpponentBidHistory().getLastBidDetails()
|
---|
50 | .getMyUndiscountedUtil();
|
---|
51 | double lastMyBidUtil = negotiationSession.getOwnBidHistory().getLastBidDetails().getMyUndiscountedUtil();
|
---|
52 |
|
---|
53 | if (lastOpponentBidUtil * acceptMultiplier > lastMyBidUtil
|
---|
54 | || lastOpponentBidUtil * acceptMultiplier > offeringStrategy.getNextBid().getMyUndiscountedUtil()
|
---|
55 | || lastOpponentBidUtil * acceptMultiplier > maximum_aspiration) {
|
---|
56 | return Actions.Accept;
|
---|
57 | }
|
---|
58 | }
|
---|
59 | return Actions.Reject;
|
---|
60 | }
|
---|
61 |
|
---|
62 | @Override
|
---|
63 | public String getName() {
|
---|
64 | return "2011 - IAMHaggler2011";
|
---|
65 | }
|
---|
66 | }
|
---|