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