source: java2python/geniuswebtranslator/geniuswebsrc/geniusweb/profile/utilityspace/UtilitySpace.java@ 566

Last change on this file since 566 was 519, checked in by wouter, 18 months ago

#169 added geniusweb sources hard copy in the project as I need to hack it a bit.

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.