Last change
on this file since 52 was 52, checked in by ruud, 14 months ago |
Fixed small issues in domaineditor.
|
File size:
731 bytes
|
Rev | Line | |
---|
[52] | 1 | package geniusweb.profile.utilityspace;
|
---|
| 2 |
|
---|
| 3 | import java.math.BigDecimal;
|
---|
| 4 |
|
---|
| 5 | import geniusweb.issuevalue.Bid;
|
---|
| 6 | import 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 | */
|
---|
| 12 | public 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.