source: src/test/java/boaexample/BoaPartyExample.java@ 172

Last change on this file since 172 was 172, checked in by Wouter Pasman, 6 years ago

#67 Changed BoaParty so that it can be overridden like AbstractNegotiationParty.

Added some instructions in the javadoc on how to use it.

updated Tim's BoaPartyExample accordingly.

File size: 1.6 KB
Line 
1package boaexample;
2
3import java.util.Collections;
4import java.util.HashMap;
5
6import genius.core.boaframework.BoaParty;
7import genius.core.parties.NegotiationInfo;
8import genius.core.utility.AbstractUtilitySpace;
9import 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 */
20public 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}
Note: See TracBrowser for help on using the repository browser.