source: src/main/java/negotiator/boaframework/acceptanceconditions/other/AC_CombiMax.java

Last change on this file was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 2.3 KB
Line 
1package negotiator.boaframework.acceptanceconditions.other;
2
3import java.util.Map;
4
5import genius.core.boaframework.AcceptanceStrategy;
6import genius.core.boaframework.Actions;
7import genius.core.boaframework.NegotiationSession;
8import genius.core.boaframework.OfferingStrategy;
9import 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 */
23public 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}
Note: See TracBrowser for help on using the repository browser.