1 | package negotiator.boaframework.acceptanceconditions.anac2011;
|
---|
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 | import negotiator.boaframework.sharedagentstate.anac2011.ValueModelAgentSAS;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * This is the decoupled Acceptance Conditions for ValueModelAgent (ANAC2011).
|
---|
14 | * The code was taken from the ANAC2011 ValueModelAgent and adapted to work
|
---|
15 | * within the BOA framework.
|
---|
16 | *
|
---|
17 | * Decoupling Negotiating Agents to Explore the Space of Negotiation Strategies
|
---|
18 | * T. Baarslag, K. Hindriks, M. Hendrikx, A. Dirkzwager, C.M. Jonker
|
---|
19 | *
|
---|
20 | * @author Mark Hendrikx
|
---|
21 | */
|
---|
22 | public class AC_ValueModelAgent extends AcceptanceStrategy {
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * Empty constructor for the BOA framework.
|
---|
26 | */
|
---|
27 | public AC_ValueModelAgent() {
|
---|
28 | }
|
---|
29 |
|
---|
30 | public AC_ValueModelAgent(NegotiationSession negoSession, OfferingStrategy strat) throws Exception {
|
---|
31 | initializeAgent(negoSession, strat);
|
---|
32 | }
|
---|
33 |
|
---|
34 | @Override
|
---|
35 | public void init(NegotiationSession negoSession, OfferingStrategy strat, OpponentModel opponentModel,
|
---|
36 | Map<String, Double> parameters) throws Exception {
|
---|
37 | initializeAgent(negoSession, strat);
|
---|
38 | }
|
---|
39 |
|
---|
40 | public void initializeAgent(NegotiationSession negotiationSession, OfferingStrategy os) throws Exception {
|
---|
41 | this.negotiationSession = negotiationSession;
|
---|
42 | this.offeringStrategy = os;
|
---|
43 |
|
---|
44 | if (os.getHelper() instanceof ValueModelAgentSAS) {
|
---|
45 | helper = os.getHelper();
|
---|
46 | } else {
|
---|
47 | helper = new ValueModelAgentSAS();
|
---|
48 | }
|
---|
49 | }
|
---|
50 |
|
---|
51 | @Override
|
---|
52 | public Actions determineAcceptability() {
|
---|
53 | boolean skip = ((ValueModelAgentSAS) helper).shouldSkipAcceptDueToCrash();
|
---|
54 | if (negotiationSession.getOpponentBidHistory().size() > 0) {
|
---|
55 |
|
---|
56 | if (!skip && negotiationSession.getTime() > 0.98 && negotiationSession.getTime() <= 0.99) {
|
---|
57 | if (((ValueModelAgentSAS) helper)
|
---|
58 | .getOpponentUtil() >= ((ValueModelAgentSAS) helper).getLowestApprovedInitial() - 0.01) {
|
---|
59 | return Actions.Accept;
|
---|
60 | }
|
---|
61 | }
|
---|
62 | if (!skip && negotiationSession.getTime() > 0.995
|
---|
63 | && ((ValueModelAgentSAS) helper).getOpponentMaxBidUtil() > 0.55) {
|
---|
64 | if (((ValueModelAgentSAS) helper)
|
---|
65 | .getOpponentUtil() >= ((ValueModelAgentSAS) helper).getOpponentMaxBidUtil() * 0.99) {
|
---|
66 | return Actions.Accept;
|
---|
67 | }
|
---|
68 | }
|
---|
69 |
|
---|
70 | // if our opponent settled enough for us we accept, and there is
|
---|
71 | // a discount factor we accept
|
---|
72 | // if(opponent.expectedDiscountRatioToConvergence()*opponentUtil
|
---|
73 | // > lowestApproved){
|
---|
74 | if (!skip
|
---|
75 | && ((ValueModelAgentSAS) helper).getOpponentUtil() > ((ValueModelAgentSAS) helper)
|
---|
76 | .getLowestApproved()
|
---|
77 | && (negotiationSession.getDiscountFactor() > 0.02
|
---|
78 | || ((ValueModelAgentSAS) helper).getOpponentUtil() > 0.975)) {
|
---|
79 | return Actions.Accept;
|
---|
80 | }
|
---|
81 | if (!skip && negotiationSession.getTime() > 0.9) {
|
---|
82 | if (((ValueModelAgentSAS) helper)
|
---|
83 | .getOpponentUtil() >= ((ValueModelAgentSAS) helper).getPlannedThreshold() - 0.01) {
|
---|
84 | return Actions.Accept;
|
---|
85 | }
|
---|
86 | }
|
---|
87 | }
|
---|
88 | return Actions.Reject;
|
---|
89 | }
|
---|
90 |
|
---|
91 | @Override
|
---|
92 | public String getName() {
|
---|
93 | return "2011 - ValueModelAgent";
|
---|
94 | }
|
---|
95 | } |
---|