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() {return new AC_Next();} private static OfferingStrategy offeringStrategy() {return new TimeDependent_Offering();} private static OpponentModel opponentModel() {return new HardHeadedFrequencyModel();} private static OMStrategy opponentModelStrategy() {return new BestBid();} // All component parameters can be set below. Static initialization is used purely for convenience as the // constructor call to super() needs to be the first statement private static Map acParams() {return new HashMap();} private static Map omParams() {return new HashMap();} private static Map omsParams() {return new HashMap();} // Set the concession parameter "e" for the offering strategy to yield Boulware-like behavior private static Map osParams() { HashMap osParams = new HashMap(); osParams.put("e", 0.2); return osParams; } public BoaPartyExample() { // This initializes all the components of this party to the choices 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(); } }