1 | package negotiator.boaframework.acceptanceconditions.other;
|
---|
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 Based on Tim Baarslag's paper on
|
---|
13 | * Acceptance Conditions: "Acceptance Conditions in Automated Negotiation"
|
---|
14 | *
|
---|
15 | * This Acceptance Condition accepts a bid if it is higher than any bid seen so
|
---|
16 | * far
|
---|
17 | *
|
---|
18 | * Decoupling Negotiating Agents to Explore the Space of Negotiation Strategies
|
---|
19 | * T. Baarslag, K. Hindriks, M. Hendrikx, A. Dirkzwager, C.M. Jonker
|
---|
20 | *
|
---|
21 | * @author Alex Dirkzwager
|
---|
22 | */
|
---|
23 | public class AC_CombiMax extends AcceptanceStrategy {
|
---|
24 |
|
---|
25 | private double time;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * Empty constructor for the BOA framework.
|
---|
29 | */
|
---|
30 | public AC_CombiMax() {
|
---|
31 | }
|
---|
32 |
|
---|
33 | public AC_CombiMax(NegotiationSession negoSession, OfferingStrategy strat, double time) {
|
---|
34 | this.negotiationSession = negoSession;
|
---|
35 | this.offeringStrategy = strat;
|
---|
36 | this.time = time;
|
---|
37 | }
|
---|
38 |
|
---|
39 | @Override
|
---|
40 | public void init(NegotiationSession negoSession, OfferingStrategy strat, OpponentModel opponentModel,
|
---|
41 | Map<String, Double> parameters) throws Exception {
|
---|
42 | this.negotiationSession = negoSession;
|
---|
43 | if (parameters.get("t") != null) {
|
---|
44 | time = parameters.get("t");
|
---|
45 | } else {
|
---|
46 | throw new Exception("Paramaters were not correctly set");
|
---|
47 | }
|
---|
48 | }
|
---|
49 |
|
---|
50 | @Override
|
---|
51 | public String printParameters() {
|
---|
52 | return "[t: " + time + "]";
|
---|
53 | }
|
---|
54 |
|
---|
55 | @Override
|
---|
56 | public Actions determineAcceptability() {
|
---|
57 | if (negotiationSession.getOpponentBidHistory().getLastBidDetails().getMyUndiscountedUtil() >= offeringStrategy
|
---|
58 | .getNextBid().getMyUndiscountedUtil()) {
|
---|
59 | return Actions.Accept;
|
---|
60 | }
|
---|
61 |
|
---|
62 | if (negotiationSession.getTime() < time) {
|
---|
63 | return Actions.Reject;
|
---|
64 | }
|
---|
65 |
|
---|
66 | double offeredUndiscountedUtility = negotiationSession.getOpponentBidHistory().getLastBidDetails()
|
---|
67 | .getMyUndiscountedUtil();
|
---|
68 | double bestUtil = negotiationSession.getOpponentBidHistory().getBestBidDetails().getMyUndiscountedUtil();
|
---|
69 |
|
---|
70 | if (offeredUndiscountedUtility >= bestUtil)
|
---|
71 | return Actions.Accept;
|
---|
72 |
|
---|
73 | return Actions.Reject;
|
---|
74 | }
|
---|
75 |
|
---|
76 | @Override
|
---|
77 | public String getName() {
|
---|
78 | return "Other - CombiMax";
|
---|
79 | }
|
---|
80 | }
|
---|