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 Conditions is a combination of AC_Time and AC_Next ->
|
---|
16 | * (AC_Time OR AC_Next)
|
---|
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_Combi extends AcceptanceStrategy {
|
---|
24 |
|
---|
25 | private double a;
|
---|
26 | private double b;
|
---|
27 | private double time;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Empty constructor for the BOA framework.
|
---|
31 | */
|
---|
32 | public AC_Combi() {
|
---|
33 | }
|
---|
34 |
|
---|
35 | public AC_Combi(NegotiationSession negoSession, OfferingStrategy strat, double a, double b, double t, double c) {
|
---|
36 | this.negotiationSession = negoSession;
|
---|
37 | this.offeringStrategy = strat;
|
---|
38 | this.a = a;
|
---|
39 | this.b = b;
|
---|
40 | this.time = t;
|
---|
41 | }
|
---|
42 |
|
---|
43 | @Override
|
---|
44 | public void init(NegotiationSession negoSession, OfferingStrategy strat, OpponentModel opponentModel,
|
---|
45 | Map<String, Double> parameters) throws Exception {
|
---|
46 | this.negotiationSession = negoSession;
|
---|
47 | if (parameters.get("c") != null && parameters.get("t") != null) {
|
---|
48 | a = parameters.get("a");
|
---|
49 | b = parameters.get("b");
|
---|
50 | time = parameters.get("t");
|
---|
51 | } else {
|
---|
52 | throw new Exception("Paramaters were not correctly set");
|
---|
53 | }
|
---|
54 | }
|
---|
55 |
|
---|
56 | @Override
|
---|
57 | public String printParameters() {
|
---|
58 | return "[a: " + a + " b: " + b + " t: " + time + "]";
|
---|
59 | }
|
---|
60 |
|
---|
61 | @Override
|
---|
62 | public Actions determineAcceptability() {
|
---|
63 |
|
---|
64 | double nextMyBidUtil = offeringStrategy.getNextBid().getMyUndiscountedUtil();
|
---|
65 | double lastOpponentBidUtil = negotiationSession.getOpponentBidHistory().getLastBidDetails()
|
---|
66 | .getMyUndiscountedUtil();
|
---|
67 | if (a * lastOpponentBidUtil + b >= nextMyBidUtil || negotiationSession.getTime() >= time) {
|
---|
68 | return Actions.Accept;
|
---|
69 | }
|
---|
70 | return Actions.Reject;
|
---|
71 | }
|
---|
72 |
|
---|
73 | @Override
|
---|
74 | public String getName() {
|
---|
75 | return "Other - Combi";
|
---|
76 | }
|
---|
77 | } |
---|