| 651 | = Writing a Boa Party |
| 652 | THe default BoaParty as mentioned in the exampleparties list is fully configurable to use BOA components. But this adds some hassle when setting up a negotiation as all the components must be explicitly added in the parameters. ALso there is no mechanism available to load BOA components into the runtime system, you need to load any required components as part of the progess of loading a Party. |
| 653 | |
| 654 | You can hard code a Boa Party by extending the DefaultBoa class. You can use all the Boa components, you can add your own components, and you wire them hard into your party. An example is proviced in the simpleboa example package. SimpleBoa looks like this |
| 655 | {{{ |
| 656 | public class SimpleBoa extends DefaultBoa { |
| 657 | @Override |
| 658 | protected Class<? extends OpponentModel> getOpponentModel(Settings settings) |
| 659 | throws InstantiationFailedException { |
| 660 | return FrequencyOpponentModel.class; |
| 661 | } |
| 662 | |
| 663 | @Override |
| 664 | protected BiddingStrategy getBiddingStrategy(Settings settings) |
| 665 | throws InstantiationFailedException { |
| 666 | return new TimeDependentBiddingStrategy() { |
| 667 | ... |
| 668 | }; |
| 669 | } |
| 670 | |
| 671 | @Override |
| 672 | protected AcceptanceStrategy getAccceptanceStrategy(Settings settings) |
| 673 | throws InstantiationFailedException { |
| 674 | return new TimeDependentAcceptanceStrategy() { |
| 675 | ... |
| 676 | }; |
| 677 | } |
| 678 | |
| 679 | } |
| 680 | }}} |
| 681 | |
| 682 | So basically you just implement the functions that provide the opponent model, bidding strategy and acceptance strategy into the DefaultBoa party. Your jar file has to be prepared identically as with a normal party. |
| 683 | |