1 | package genius.core.boaframework;
|
---|
2 |
|
---|
3 | import java.io.Serializable;
|
---|
4 | import java.util.Map;
|
---|
5 |
|
---|
6 | import 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 | */
|
---|
17 | public 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 | } |
---|