package agents.ai2014.group3; import java.util.ArrayList; import genius.core.AgentID; import genius.core.Bid; public class Strategy { // Just Static methods private Strategy() { super(); } /* * Generate the next Bid based on the Utility value for this round. */ public static Bid calculateMyBid(Group3 info) { double U = nextBidUtility(info); // Get a List of bids with this utility or more 10% ArrayList bidsInRange = BidGenerator.getBidsInRange(info.getPossibleBids(), U, U*1.1, info); if(bidsInRange.isEmpty()) return null; // Select the best bid for our opponents return bidSelect(bidsInRange,info.getAgentUtilsList()); } // Receives a List of bids, and a list of agentUtils, selects the bid that maximizes the minimum utility over all agents public static Bid bidSelect(ArrayList bids, ArrayList agentUtils) { Bid bestBid =null; double bestBidUtil=0; for(int i=0; i ((double) info.getRoundN())/info.roundDeadline()) && (((double) info.getRoundN())/info.roundDeadline() >=0.2)){ return 1-(0.2*(1-info.getUtilitySpace().getReservationValue())); } else { return 1- (4*((double) info.getRoundN())/info.roundDeadline()-3)*(1-info.getUtilitySpace().getReservationValue()); } } // Returns true if we should accept. public static boolean acceptingConditions(Group3 info) { // Check if the offer we received has higher utility than our target utility if(nextBidUtility(info)>lastOfferUtility(info)) { return false; } // check if we received an offer that has larger utility than this one else if(lastOfferUtility(info)