source: src/main/java/negotiator/boaframework/acceptanceconditions/anac2010/AC_AgentFSEGA.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.2 KB
Line 
1package negotiator.boaframework.acceptanceconditions.anac2010;
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 Condition from AgentFSEGA (ANAC2010). The
13 * code was taken from the ANAC2010 AgentFSEGA and adapted to work within the
14 * BOA framework.
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 26/12/11
21 */
22public class AC_AgentFSEGA extends AcceptanceStrategy {
23 private double maxUtilInDomain;
24
25 /**
26 * Empty constructor for the BOA framework.
27 */
28 public AC_AgentFSEGA() {
29 }
30
31 public AC_AgentFSEGA(NegotiationSession negoSession, OfferingStrategy strat) throws Exception {
32 init(negoSession, strat, null, null);
33 }
34
35 @Override
36 public void init(NegotiationSession negoSession, OfferingStrategy strat, OpponentModel opponentModel,
37 Map<String, Double> parameters) throws Exception {
38 this.negotiationSession = negoSession;
39 this.offeringStrategy = strat;
40 maxUtilInDomain = negotiationSession.getMaxBidinDomain().getMyUndiscountedUtil();
41 }
42
43 @Override
44 public Actions determineAcceptability() {
45
46 if (negotiationSession.getOpponentBidHistory().getHistory().isEmpty()
47 || negotiationSession.getOwnBidHistory().getHistory().isEmpty()) {
48 return Actions.Reject;
49 } else {
50 double lastOpponentBidUtil = negotiationSession.getOpponentBidHistory().getLastBidDetails()
51 .getMyUndiscountedUtil();
52 double lastMyBidUtil = negotiationSession.getOwnBidHistory().getLastBidDetails().getMyUndiscountedUtil();
53 double nextMyBidUtil = offeringStrategy.getNextBid().getMyUndiscountedUtil();
54
55 if ((lastOpponentBidUtil * 1.03 >= lastMyBidUtil) || (lastOpponentBidUtil > nextMyBidUtil)
56 || (lastOpponentBidUtil == maxUtilInDomain)) {
57 return Actions.Accept;
58 }
59 }
60 return Actions.Reject;
61 }
62
63 @Override
64 public String getName() {
65 return "2010 - AgentFSEGA";
66 }
67}
Note: See TracBrowser for help on using the repository browser.