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

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

#67 fixed BoaPartyExample

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