Changeset 24 for profile/src/main/java/geniusweb
- Timestamp:
- 10/06/20 13:12:20 (4 years ago)
- Location:
- profile/src/main/java/geniusweb/profile
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
profile/src/main/java/geniusweb/profile/DefaultPartialOrdering.java
r10 r24 37 37 /** 38 38 * 39 * @param name 40 * @param domain 41 * @param reservationbid 42 * @param bids 39 * @param name name of the profile 40 * @param domain the {@link Domain} 41 * @param reservationbid the reservation bid, this is the minimum acceptable 42 * bid 43 * @param bids a list of bids that this ordering contains 44 * comparisons for 43 45 * @param isbetterList a list of tuples [bid1index, bid2index]. It 44 46 * indicates that bids[bid1index] isbetterthan -
profile/src/main/java/geniusweb/profile/FullOrdering.java
r1 r24 11 11 * @param bid1 the first item's utility/preference 12 12 * @param bid2 the second item's utility/preference 13 * @return true iff bid1 is considered better or equal (≥) than bid 2. In all14 * other cases false is returned.13 * @return true iff bid1 is considered better or equal (≥) than bid 2. In 14 * all other cases false is returned. 15 15 * 16 16 * This predicate should be implemented such that 17 * <ul> 17 18 * <li>For all b1 and b2, either b1 ≥ b2 or b2 ≥ b1. 18 19 * <li>b ≥ b (every bid is better or equal to itself) 19 * <li>If b1≥b2 and b2≥b1 then the two bids are considered equally 20 * good. Note that this differes from a partial order in mathematics. 21 * <li>it behaves transitive: if b1≥b2 and b2≥b3 then b1≥b3. 20 * <li>If b1≥b2 and b2≥b1 then the two bids are considered 21 * equally good. Note that this differes from a partial order in 22 * mathematics. 23 * <li>it behaves transitive: if b1≥b2 and b2≥b3 then 24 * b1≥b3. 25 * </ul> 22 26 */ 23 27 @Override -
profile/src/main/java/geniusweb/profile/PartialOrdering.java
r1 r24 13 13 * @param bid1 the first item's utility/preference 14 14 * @param bid2 the second item's utility/preference 15 * @return true iff bid1 is considered better or equal (≥) than bid 2. In all16 * other cases false is returned. A bid may not have a ≥ relation at17 * all.15 * @return true iff bid1 is considered better or equal (≥) than bid 2. In 16 * all other cases false is returned. A bid may not have a ≥ 17 * relation at all. 18 18 * 19 19 * This predicate should be implemented such that 20 * <ul> 20 21 * <li>b ≥ b (every bid is better or equal to itself) 21 * <li>If b1≥b2 and b2≥b1 then the two bids are considered equally 22 * good. Note that this differes from a partial order in mathematics. 23 * <li>it behaves transitive: if b1≥b2 and b2≥b3 then b1≥b3. 22 * <li>If b1≥b2 and b2≥b1 then the two bids are considered 23 * equally good. Note that this differes from a partial order in 24 * mathematics. 25 * <li>it behaves transitive: if b1≥b2 and b2≥b3 then 26 * b1≥b3. 27 * </ul> 24 28 */ 25 29 boolean isPreferredOrEqual(Bid bid1, Bid bid2); -
profile/src/main/java/geniusweb/profile/Profile.java
r9 r24 36 36 * 37 37 * @return a (hypothetical) bid that is the best alternative to a 38 * non-agreement. Only bids that are 39 * {@link #isPreferredOrEqual(Bid, Bid)} should be accepted. If a 40 * negotiation does not reach an agreement, the party can get this 41 * offer somewhere else. This replaces the older notion of a 42 * "reservation value" and is more general. If null, there is no 43 * reservation bid and any agreement is better than no agreement. 38 * non-agreement. Only bids that are equal or better should be 39 * accepted. If a negotiation does not reach an agreement, the party 40 * can get this offer somewhere else. This replaces the older notion 41 * of a "reservation value" and is more general. If null, there is 42 * no reservation bid and any agreement is better than no agreement. 44 43 * 45 44 */ -
profile/src/main/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilities.java
r10 r24 20 20 * issue so may need further checking when used for an actual issue. Constructor 21 21 * guarantees that 22 * <ul> 22 23 * <li>All values in the provided map (the utilities) are in [0,1] 23 24 * <li>All keys are proper {@link DiscreteValue}s 25 * </ul> 24 26 */ 25 27 @JsonTypeName("discreteutils") -
profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditive.java
r10 r24 22 22 /** 23 23 * 24 * @param issue 24 * @param issue the issue name 25 25 * @return the weight of the given issue 26 26 */ -
profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditiveUtilitySpace.java
r14 r24 20 20 * 21 21 * Constructor guarantees that 22 * <ul> 22 23 * <li>weights are normalized to 1 23 24 * <li>the issues in the utility map and weights map match those in the domain 24 25 * <li>The utilities for each issue are proper {@link ValueSetUtilities} objects 26 * </ul> 25 27 */ 26 28 @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE) -
profile/src/main/java/geniusweb/profile/utilityspace/NumberValueSetUtilities.java
r14 r24 40 40 * @param lowUtility the utility of the {@link #lowValue} 41 41 * @param highValue the high value of the {@link Range}. Must be 42 * >lowValue.42 * >lowValue. 43 43 * @param highUtility the utility of the {@link #highValue} 44 44 */ -
profile/src/main/java/geniusweb/profile/utilityspace/PartsUtilities.java
r9 r24 19 19 /** 20 20 * Contains utilities of a ProductOfValue of a {@link SumOfGroupsUtilitySpace}. 21 * So this is similar to a DiscreteValueSetUtilities but instead of issues this22 * contains an (ordered) list of issues. This object serializes to something23 * like <code>21 * So this is similar to a {@link DiscreteValueSetUtilities} but instead of 22 * issues this contains an (ordered) list of issues. This object serializes to 23 * something like <code> 24 24 * {"partsutils": 25 25 * {"issues":["issue1","issue2"], … … 29 29 * N issue values, in the same order as the issues list and with "util" 30 30 * containng the utility value of that set of values. 31 * <p>32 31 */ 33 32 @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE) … … 43 42 /** 44 43 * 45 * @param issues 44 * @param issues list of issues 46 45 * @param utils with keys: list of values and value: utility value for that 47 46 * list of values. All list-of-values missing from the map are -
profile/src/main/java/geniusweb/profile/utilityspace/ProductOfValue.java
r9 r24 19 19 20 20 /** 21 * @param values the values to make a product of21 * @param newvals the values to make a product of 22 22 */ 23 23 @JsonCreator -
profile/src/main/java/geniusweb/profile/utilityspace/SumOfGroupsUtilitySpace.java
r10 r24 47 47 48 48 /** 49 * @param domain the {@link Domain} in which this profile is defined. 50 * @param name the name of this profile. Must be simple name (a-Z, 0-9) 51 * @param utils a map with key: part names (String) and value: the 52 * {@link PartsUtilities} for that part. There MUST NOT be a 53 * null part name. All values MUST NOT be null. The 54 * PartsUtilities must match the 55 * @param weights the weight of each part, for the computation of the 56 * weighted sum. The parts must be the same as those in the 57 * utils map. All weights MUST NOT be null. The weights MUST 58 * sum to 1. 59 * @param resBid the reservation bid. Only bids that are 60 * {@link #isPreferredOrEqual(Bid, Bid)} should be accepted. 61 * Can be null, meaning that there is no reservation bid and 62 * any agreement is better than no agreement. 49 * @param domain the {@link Domain} in which this profile is defined. 50 * @param name the name of this profile. Must be simple name (a-Z, 0-9) 51 * @param partutils a map with key: part names (String) and value: the 52 * {@link PartsUtilities} for that part. There MUST NOT be 53 * a null part name. All values MUST NOT be null. The 54 * PartsUtilities must match the 55 * @param resBid the reservation bid. Only bids that are 56 * {@link #isPreferredOrEqual(Bid, Bid)} should be 57 * accepted. Can be null, meaning that there is no 58 * reservation bid and any agreement is better than no 59 * agreement. 63 60 * @throws NullPointerException if values are incorrectly null. 64 61 * @throws IllegalArgumentException if preconditions not met. … … 68 65 @JsonProperty("name") String name, 69 66 @JsonProperty("partUtilities") HashMap<String, PartsUtilities> partutils, 70 // @JsonProperty("partWeights") Map<String, BigDecimal> weights,71 67 @JsonProperty("reservationBid") Bid resBid) { 72 68 super(name, domain, resBid); -
profile/src/main/java/geniusweb/profile/utilityspace/ValueSetUtilities.java
r1 r24 5 5 import com.fasterxml.jackson.annotation.JsonSubTypes; 6 6 import com.fasterxml.jackson.annotation.JsonSubTypes.Type; 7 import com.fasterxml.jackson.annotation.JsonTypeInfo; 7 8 8 9 import geniusweb.issuevalue.Value; 9 10 import geniusweb.issuevalue.ValueSet; 10 11 import com.fasterxml.jackson.annotation.JsonTypeInfo;12 11 13 12 /** … … 16 15 */ 17 16 @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT) 18 @JsonSubTypes({ @Type(value = DiscreteValueSetUtilities.class), @Type(value = NumberValueSetUtilities.class) }) 17 @JsonSubTypes({ @Type(value = DiscreteValueSetUtilities.class), 18 @Type(value = NumberValueSetUtilities.class) }) 19 19 public interface ValueSetUtilities { 20 20 /** 21 21 * 22 * @param value 23 * @return the utility of the given value. MUST be in [0,1]. Should return 0 if24 * the value is unknown.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 25 */ 26 26 BigDecimal getUtility(Value value); … … 28 28 /** 29 29 * 30 * @param values the valueset that30 * @param valueset the valueset that is supposed match with this 31 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. Or a33 * string containing an explanation why not.32 * means it can give utilities for all possible values in valueset. 33 * Or a string containing an explanation why not. 34 34 */ 35 35 String isFitting(ValueSet valueset);
Note:
See TracChangeset
for help on using the changeset viewer.