Rev | Line | |
---|
[52] | 1 | package geniusweb.profile.utilityspace;
|
---|
| 2 |
|
---|
| 3 | import java.math.BigDecimal;
|
---|
| 4 |
|
---|
| 5 | import com.fasterxml.jackson.annotation.JsonSubTypes;
|
---|
| 6 | import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
---|
| 7 | import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
---|
| 8 |
|
---|
| 9 | import geniusweb.issuevalue.Value;
|
---|
| 10 | import geniusweb.issuevalue.ValueSet;
|
---|
| 11 |
|
---|
| 12 | /**
|
---|
| 13 | * Provides a mechanism to map {@link Value}s into a utility (value in range
|
---|
| 14 | * [0,1]).
|
---|
| 15 | */
|
---|
| 16 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
|
---|
| 17 | @JsonSubTypes({ @Type(value = DiscreteValueSetUtilities.class),
|
---|
| 18 | @Type(value = NumberValueSetUtilities.class) })
|
---|
| 19 | public interface ValueSetUtilities {
|
---|
| 20 | /**
|
---|
| 21 | *
|
---|
| 22 | * @param value the {@link Value} to get the utility for
|
---|
| 23 | * @return the utility of the given value. MUST be in [0,1]. Should return 0
|
---|
| 24 | * if the value is unknown.
|
---|
| 25 | */
|
---|
| 26 | BigDecimal getUtility(Value value);
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | *
|
---|
| 30 | * @param valueset the valueset that is supposed match with this
|
---|
| 31 | * @return null if the ValueSetUtilities fits the given set of values , that
|
---|
| 32 | * means it can give utilities for all possible values in valueset.
|
---|
| 33 | * Or a string containing an explanation why not.
|
---|
| 34 | */
|
---|
| 35 | String isFitting(ValueSet valueset);
|
---|
| 36 |
|
---|
| 37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.