1 | package boaexample;
|
---|
2 |
|
---|
3 | import java.util.Collections;
|
---|
4 | import java.util.HashMap;
|
---|
5 |
|
---|
6 | import genius.core.boaframework.BoaParty;
|
---|
7 | import genius.core.parties.NegotiationInfo;
|
---|
8 | import genius.core.utility.AbstractUtilitySpace;
|
---|
9 | import negotiator.boaframework.opponentmodel.HardHeadedFrequencyModel;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * This example shows how BOA components can be made into an independent
|
---|
13 | * negotiation party.
|
---|
14 | *
|
---|
15 | * Note that this is equivalent to adding a BOA party via the GUI by selecting
|
---|
16 | * the components and parameters. However, this method gives more control over
|
---|
17 | * the implementation, as the agent designer can choose to override behavior
|
---|
18 | * (such as handling preference uncertainty).
|
---|
19 | */
|
---|
20 | public class BoaPartyExample extends BoaParty {
|
---|
21 |
|
---|
22 | @Override
|
---|
23 | public void init(NegotiationInfo info) {
|
---|
24 | HashMap<String, Double> noparams = (HashMap<String, Double>) Collections.EMPTY_MAP;
|
---|
25 | HashMap<String, Double> osParams = new HashMap<String, Double>();
|
---|
26 | // Set the concession parameter "e" for the offering strategy to yield
|
---|
27 | // Boulware-like behavior
|
---|
28 | osParams.put("e", 0.2);
|
---|
29 |
|
---|
30 | configure(new AC_Next(), noparams, new TimeDependent_Offering(),
|
---|
31 | osParams, new HardHeadedFrequencyModel(), noparams,
|
---|
32 | new BestBid(), noparams);
|
---|
33 | super.init(info);
|
---|
34 | }
|
---|
35 |
|
---|
36 | // All the rest of the functionality is defined by the BOA framework
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Specific functionality, such as the estimate of the utility space in the
|
---|
40 | * face of preference uncertainty, can be specified by overriding the
|
---|
41 | * default behavior.
|
---|
42 | */
|
---|
43 | @Override
|
---|
44 | public AbstractUtilitySpace estimateUtilitySpace() {
|
---|
45 | return super.estimateUtilitySpace();
|
---|
46 | }
|
---|
47 |
|
---|
48 | }
|
---|