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
RevLine 
[167]1package boaexample;
2
[172]3import java.util.Collections;
[167]4import java.util.HashMap;
[177]5import java.util.Map;
[167]6
7import genius.core.boaframework.BoaParty;
[174]8import genius.core.parties.NegotiationInfo;
[167]9import genius.core.utility.AbstractUtilitySpace;
[177]10import negotiator.boaframework.opponentmodel.HardHeadedFrequencyModel;
[167]11
12/**
[172]13 * This example shows how BOA components can be made into an independent
14 * negotiation party.
[167]15 *
[172]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).
[167]20 */
[177]21@SuppressWarnings("serial")
[172]22public class BoaPartyExample extends BoaParty {
[169]23
[172]24 @Override
[177]25 public void init(NegotiationInfo info) {
26 Map<String, Double> noparams = Collections.emptyMap();
27 Map<String, Double> osParams = new HashMap<String, Double>();
[172]28 // Set the concession parameter "e" for the offering strategy to yield
29 // Boulware-like behavior
[169]30 osParams.put("e", 0.2);
[177]31
32 configure(new AC_Next(), noparams, new TimeDependent_Offering(),
33 osParams, new HardHeadedFrequencyModel(), noparams,
34 new BestBid(), noparams);
[172]35 super.init(info);
[167]36 }
[172]37
[177]38 // All the rest of the functionality is defined by the BOA framework
39
[167]40 /**
[172]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.
[167]44 */
45 @Override
[172]46 public AbstractUtilitySpace estimateUtilitySpace() {
[177]47 return super.estimateUtilitySpace();
[167]48 }
[169]49
[177]50 @Override
51 public String getDescription() {
52 return "Boa Party Example";
53 }
54
[167]55}
Note: See TracBrowser for help on using the repository browser.