package geniusweb.profile.utilityspace; import java.math.BigDecimal; import geniusweb.issuevalue.Bid; import geniusweb.profile.FullOrdering; /** * A utilityspace defines a profile in terms of a utility of a bid. Bids with * higher utility are preferred over bids with less utility. */ public interface UtilitySpace extends FullOrdering { /** * @param bid the {@link Bid} to be evaluated * @return the utility value of this bid. This MUST return a number in the range * [0,1]. 0 means preferred the least and 1 means preferred the most. */ BigDecimal getUtility(Bid bid); @Override default boolean isPreferredOrEqual(Bid bid1, Bid bid2) { return getUtility(bid1).compareTo(getUtility(bid2)) >= 0; } }