1 | package negotiator.boaframework.acceptanceconditions.other;
|
---|
2 |
|
---|
3 | import java.util.Map;
|
---|
4 |
|
---|
5 | import genius.core.bidding.BidDetails;
|
---|
6 | import genius.core.boaframework.AcceptanceStrategy;
|
---|
7 | import genius.core.boaframework.Actions;
|
---|
8 | import genius.core.boaframework.NegotiationSession;
|
---|
9 | import genius.core.boaframework.OfferingStrategy;
|
---|
10 | import genius.core.boaframework.OpponentModel;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * This Acceptance Condition accepts an opponent bid if the utility is above a
|
---|
14 | * constant.
|
---|
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 15-12-11
|
---|
21 | */
|
---|
22 | public class AC_ConstDiscounted extends AcceptanceStrategy {
|
---|
23 |
|
---|
24 | private double constant;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * Empty constructor for the BOA framework.
|
---|
28 | */
|
---|
29 | public AC_ConstDiscounted() {
|
---|
30 | }
|
---|
31 |
|
---|
32 | public AC_ConstDiscounted(NegotiationSession negoSession, double c) {
|
---|
33 | this.negotiationSession = negoSession;
|
---|
34 | this.constant = c * (Math.pow(negoSession.getDiscountFactor(), negoSession.getTime()));
|
---|
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 | if (parameters.get("c") != null) {
|
---|
42 | constant = parameters.get("c");
|
---|
43 | } else {
|
---|
44 | throw new Exception("Constant \"c\" for the threshold was not set.");
|
---|
45 | }
|
---|
46 | }
|
---|
47 |
|
---|
48 | @Override
|
---|
49 | public String printParameters() {
|
---|
50 | return "[c: " + constant + "]";
|
---|
51 | }
|
---|
52 |
|
---|
53 | @Override
|
---|
54 | public Actions determineAcceptability() {
|
---|
55 | BidDetails opponentBid = negotiationSession.getOpponentBidHistory().getLastBidDetails();
|
---|
56 | if (opponentBid.getMyUndiscountedUtil() > constant) {
|
---|
57 | return Actions.Accept;
|
---|
58 | }
|
---|
59 | return Actions.Reject;
|
---|
60 | }
|
---|
61 |
|
---|
62 | @Override
|
---|
63 | public String getName() {
|
---|
64 | return "Other - ConstDiscounted";
|
---|
65 | }
|
---|
66 | } |
---|