[167] | 1 | package boaexample;
|
---|
| 2 |
|
---|
[172] | 3 | import java.util.Collections;
|
---|
[167] | 4 | import java.util.HashMap;
|
---|
| 5 |
|
---|
| 6 | import genius.core.boaframework.BoaParty;
|
---|
[172] | 7 | import genius.core.parties.NegotiationInfo;
|
---|
[167] | 8 | import genius.core.utility.AbstractUtilitySpace;
|
---|
[172] | 9 | import 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] | 20 | public 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 | }
|
---|