package boaexample; import java.util.HashMap; import java.util.Map; import negotiator.boaframework.opponentmodel.HardHeadedFrequencyModel; import genius.core.boaframework.AcceptanceStrategy; import genius.core.boaframework.BoaParty; import genius.core.boaframework.OMStrategy; import genius.core.boaframework.OfferingStrategy; import genius.core.boaframework.OpponentModel; import genius.core.utility.AbstractUtilitySpace; /** * This example shows how BOA components can be made into an independent negotiation party. * * Note that this is equivalent to adding a BOA party via the GUI by selecting the components and parameters. * However, this method gives more control over the implementation, as the agent designer can * choose to override behavior (such as handling preference uncertainty). */ public class BoaPartyExample extends BoaParty { // The choice for each component is made here private static AcceptanceStrategy acceptanceStrategy = new AC_Next(); private static OfferingStrategy offeringStrategy = new TimeDependent_Offering(); private static OpponentModel opponentModel = new HardHeadedFrequencyModel(); private static OMStrategy opponentModelStrategy = new BestBid(); // All component parameters can be set below. A static block is used purely for convenience as the // constructor call to super() needs to be the first statement private static Map acParams = new HashMap(); private static Map osParams = new HashMap(); private static Map omParams = new HashMap(); private static Map omsParams = new HashMap(); static { // Set the concession parameter "e" for the offering strategy to yield Boulware-like behavior osParams.put("e", 0.2); } public BoaPartyExample() { // This initializes all the components of this party to the static fields defined above super(acceptanceStrategy, acParams, offeringStrategy, osParams, opponentModel, omParams, opponentModelStrategy, omsParams); } // All the rest of the functionality is defined by the BOA framework /** * Specific functionality, such as the estimate of the utility space in the face of preference uncertainty, * can be specified by overriding the default behavior. */ @Override public AbstractUtilitySpace estimateUtilitySpace() { return super.estimateUtilitySpace(); } }