source: profile/src/main/java/geniusweb/profile/utilityspace/UtilitySpace.java

Last change on this file was 52, checked in by ruud, 13 months ago

Fixed small issues in domaineditor.

File size: 731 bytes
Line 
1package geniusweb.profile.utilityspace;
2
3import java.math.BigDecimal;
4
5import geniusweb.issuevalue.Bid;
6import geniusweb.profile.FullOrdering;
7
8/**
9 * A utilityspace defines a profile in terms of a utility of a bid. Bids with
10 * higher utility are preferred over bids with less utility.
11 */
12public interface UtilitySpace extends FullOrdering {
13 /**
14 * @param bid the {@link Bid} to be evaluated
15 * @return the utility value of this bid. This MUST return a number in the range
16 * [0,1]. 0 means preferred the least and 1 means preferred the most.
17 */
18 BigDecimal getUtility(Bid bid);
19
20 @Override
21 default boolean isPreferredOrEqual(Bid bid1, Bid bid2) {
22 return getUtility(bid1).compareTo(getUtility(bid2)) >= 0;
23 }
24
25}
Note: See TracBrowser for help on using the repository browser.