1 | package negotiator.boaframework.acceptanceconditions.other;
|
---|
2 |
|
---|
3 | import java.util.HashSet;
|
---|
4 | import java.util.Map;
|
---|
5 | import java.util.Set;
|
---|
6 |
|
---|
7 | import genius.core.boaframework.AcceptanceStrategy;
|
---|
8 | import genius.core.boaframework.Actions;
|
---|
9 | import genius.core.boaframework.BOAparameter;
|
---|
10 | import genius.core.boaframework.NegotiationSession;
|
---|
11 | import genius.core.boaframework.OfferingStrategy;
|
---|
12 | import genius.core.boaframework.OpponentModel;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * This Acceptance Condition will accept an opponent bid if the utility is
|
---|
16 | * higher than the bid the agent is ready to present
|
---|
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, Mark Hendrikx
|
---|
22 | * @version 18/12/11
|
---|
23 | */
|
---|
24 | public class AC_Next extends AcceptanceStrategy {
|
---|
25 |
|
---|
26 | private double a;
|
---|
27 | private double b;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Empty constructor for the BOA framework.
|
---|
31 | */
|
---|
32 | public AC_Next() {
|
---|
33 | }
|
---|
34 |
|
---|
35 | public AC_Next(NegotiationSession negoSession, OfferingStrategy strat, double alpha, double beta) {
|
---|
36 | this.negotiationSession = negoSession;
|
---|
37 | this.offeringStrategy = strat;
|
---|
38 | this.a = alpha;
|
---|
39 | this.b = beta;
|
---|
40 | }
|
---|
41 |
|
---|
42 | @Override
|
---|
43 | public void init(NegotiationSession negoSession, OfferingStrategy strat, OpponentModel opponentModel,
|
---|
44 | Map<String, Double> parameters) throws Exception {
|
---|
45 | this.negotiationSession = negoSession;
|
---|
46 | this.offeringStrategy = strat;
|
---|
47 |
|
---|
48 | if (parameters.get("a") != null || parameters.get("b") != null) {
|
---|
49 | a = parameters.get("a");
|
---|
50 | b = parameters.get("b");
|
---|
51 | } else {
|
---|
52 | a = 1;
|
---|
53 | b = 0;
|
---|
54 | }
|
---|
55 | }
|
---|
56 |
|
---|
57 | @Override
|
---|
58 | public String printParameters() {
|
---|
59 | String str = "[a: " + a + " b: " + b + "]";
|
---|
60 | return str;
|
---|
61 | }
|
---|
62 |
|
---|
63 | @Override
|
---|
64 | public Actions determineAcceptability() {
|
---|
65 | double nextMyBidUtil = offeringStrategy.getNextBid().getMyUndiscountedUtil();
|
---|
66 | double lastOpponentBidUtil = negotiationSession.getOpponentBidHistory().getLastBidDetails()
|
---|
67 | .getMyUndiscountedUtil();
|
---|
68 |
|
---|
69 | if (a * lastOpponentBidUtil + b >= nextMyBidUtil) {
|
---|
70 | return Actions.Accept;
|
---|
71 | }
|
---|
72 | return Actions.Reject;
|
---|
73 | }
|
---|
74 |
|
---|
75 | @Override
|
---|
76 | public Set<BOAparameter> getParameterSpec() {
|
---|
77 |
|
---|
78 | Set<BOAparameter> set = new HashSet<BOAparameter>();
|
---|
79 | set.add(new BOAparameter("a", 1.0,
|
---|
80 | "Accept when the opponent's utility * a + b is greater than the utility of our current bid"));
|
---|
81 | set.add(new BOAparameter("b", 0.0,
|
---|
82 | "Accept when the opponent's utility * a + b is greater than the utility of our current bid"));
|
---|
83 |
|
---|
84 | return set;
|
---|
85 | }
|
---|
86 |
|
---|
87 | @Override
|
---|
88 | public String getName() {
|
---|
89 | return "Other - Next";
|
---|
90 | }
|
---|
91 | } |
---|