source: src/main/java/genius/core/boaframework/AcceptanceStrategy.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.9 KB
Line 
1package genius.core.boaframework;
2
3import java.io.Serializable;
4import java.util.Map;
5
6import genius.core.protocol.BilateralAtomicNegotiationSession;
7
8/**
9 * Describes an acceptance strategy of an agent of the BOA framework.
10 *
11 * Tim Baarslag, Koen Hindriks, Mark Hendrikx, Alex Dirkzwager and Catholijn M.
12 * Jonker. Decoupling Negotiating Agents to Explore the Space of Negotiation
13 * Strategies
14 *
15 * @author Alex Dirkzwager, Mark Hendrikx
16 */
17public abstract class AcceptanceStrategy extends BOA {
18
19 /** Reference to the offering strategy. */
20 protected OfferingStrategy offeringStrategy;
21 /**
22 * Reference to the helper-object, which is used when there is overlap
23 * between the acceptance condition and offering strategy.
24 */
25 protected SharedAgentState helper;
26 /** Reference to opponnent model of agent. */
27 protected OpponentModel opponentModel;
28
29 /**
30 * Standard initialize method to be called after using the empty
31 * constructor. Most of the time this method should be overridden for usage
32 * by the decoupled framework.
33 *
34 * @param negotiationSession
35 * state of the negotiation.
36 * @param offeringStrategy
37 * of the agent.
38 * @param parameters
39 * of the acceptance strategy.
40 * @throws Exception
41 * thrown when initializing the acceptance strategy fails.
42 */
43 public void init(NegotiationSession negotiationSession, OfferingStrategy offeringStrategy,
44 OpponentModel opponentModel, Map<String, Double> parameters) throws Exception {
45 super.init(negotiationSession, parameters);
46 this.offeringStrategy = offeringStrategy;
47 this.opponentModel = opponentModel;
48 }
49
50 /**
51 * @return string representation of the parameters supplied to the model.
52 */
53 public String printParameters() {
54 return "";
55 }
56
57 /**
58 * Method which may be overwritten to get access to the opponent's
59 * utilityspace in an experimental setup.
60 *
61 * @param fNegotiation
62 * reference to negotiation setting.
63 */
64 public void setOpponentUtilitySpace(BilateralAtomicNegotiationSession fNegotiation) {
65 }
66
67 /**
68 * Determines to either to either accept or reject the opponent's bid or
69 * even quit the negotiation.
70 *
71 * @return one of three possible actions: Actions.Accept, Actions.Reject,
72 * Actions.Break.
73 */
74 public abstract Actions determineAcceptability();
75
76 @Override
77 public final void storeData(Serializable object) {
78 negotiationSession.setData(BoaType.ACCEPTANCESTRATEGY, object);
79 }
80
81 @Override
82 public final Serializable loadData() {
83 return negotiationSession.getData(BoaType.ACCEPTANCESTRATEGY);
84 }
85
86 /**
87 * Method which states if the current acceptance strategy is the
88 * Multi-Acceptance Strategy. This method should always return false, except
89 * for the MAC.
90 *
91 * @return if AC is MAC.
92 */
93 public boolean isMAC() {
94 return false;
95 }
96
97}
Note: See TracBrowser for help on using the repository browser.