Changeset 24 for profile/src/main/java


Ignore:
Timestamp:
10/06/20 13:12:20 (4 years ago)
Author:
bart
Message:

Fixes an issue with processing maxPower of a vote. Javadoc maven plugin now uses latest version.

Location:
profile/src/main/java/geniusweb/profile
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • profile/src/main/java/geniusweb/profile/DefaultPartialOrdering.java

    r10 r24  
    3737        /**
    3838         *
    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
    4345         * @param isbetterList   a list of tuples [bid1index, bid2index]. It
    4446         *                       indicates that bids[bid1index] isbetterthan
  • profile/src/main/java/geniusweb/profile/FullOrdering.java

    r1 r24  
    1111         * @param bid1 the first item's utility/preference
    1212         * @param bid2 the second item's utility/preference
    13          * @return true iff bid1 is considered better or equal (≥) than bid 2. In all
    14          *         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.
    1515         *
    1616         *         This predicate should be implemented such that
     17         *         <ul>
    1718         *         <li>For all b1 and b2, either b1 &ge; b2 or b2 &ge; b1.
    1819         *         <li>b &ge; b (every bid is better or equal to itself)
    19          *         <li>If b1&ge;b2 and b2&ge;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&ge;b2 and b2&ge;b3 then b1&ge;b3.
     20         *         <li>If b1&ge;b2 and b2&ge;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&ge;b2 and b2&ge;b3 then
     24         *         b1&ge;b3.
     25         *         </ul>
    2226         */
    2327        @Override
  • profile/src/main/java/geniusweb/profile/PartialOrdering.java

    r1 r24  
    1313         * @param bid1 the first item's utility/preference
    1414         * @param bid2 the second item's utility/preference
    15          * @return true iff bid1 is considered better or equal (&ge;) than bid 2. In all
    16          *         other cases false is returned. A bid may not have a &ge; relation at
    17          *         all.
     15         * @return true iff bid1 is considered better or equal (&ge;) than bid 2. In
     16         *         all other cases false is returned. A bid may not have a &ge;
     17         *         relation at all.
    1818         *
    1919         *         This predicate should be implemented such that
     20         *         <ul>
    2021         *         <li>b &ge; b (every bid is better or equal to itself)
    21          *         <li>If b1&ge;b2 and b2&ge;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&ge;b2 and b2&ge;b3 then b1&ge;b3.
     22         *         <li>If b1&ge;b2 and b2&ge;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&ge;b2 and b2&ge;b3 then
     26         *         b1&ge;b3.
     27         *         </ul>
    2428         */
    2529        boolean isPreferredOrEqual(Bid bid1, Bid bid2);
  • profile/src/main/java/geniusweb/profile/Profile.java

    r9 r24  
    3636         *
    3737         * @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.
    4443         *
    4544         */
  • profile/src/main/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilities.java

    r10 r24  
    2020 * issue so may need further checking when used for an actual issue. Constructor
    2121 * guarantees that
     22 * <ul>
    2223 * <li>All values in the provided map (the utilities) are in [0,1]
    2324 * <li>All keys are proper {@link DiscreteValue}s
     25 * </ul>
    2426 */
    2527@JsonTypeName("discreteutils")
  • profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditive.java

    r10 r24  
    2222        /**
    2323         *
    24          * @param issue
     24         * @param issue the issue name
    2525         * @return the weight of the given issue
    2626         */
  • profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditiveUtilitySpace.java

    r14 r24  
    2020 *
    2121 * Constructor guarantees that
     22 * <ul>
    2223 * <li>weights are normalized to 1
    2324 * <li>the issues in the utility map and weights map match those in the domain
    2425 * <li>The utilities for each issue are proper {@link ValueSetUtilities} objects
     26 * </ul>
    2527 */
    2628@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
  • profile/src/main/java/geniusweb/profile/utilityspace/NumberValueSetUtilities.java

    r14 r24  
    4040         * @param lowUtility  the utility of the {@link #lowValue}
    4141         * @param highValue   the high value of the {@link Range}. Must be
    42          *                    >lowValue.
     42         *                    &gt;lowValue.
    4343         * @param highUtility the utility of the {@link #highValue}
    4444         */
  • profile/src/main/java/geniusweb/profile/utilityspace/PartsUtilities.java

    r9 r24  
    1919/**
    2020 * Contains utilities of a ProductOfValue of a {@link SumOfGroupsUtilitySpace}.
    21  * So this is similar to a DiscreteValueSetUtilities but instead of issues this
    22  * contains an (ordered) list of issues. This object serializes to something
    23  * 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>
    2424 * {"partsutils":
    2525 * {"issues":["issue1","issue2"],
     
    2929 * N issue values, in the same order as the issues list and with "util"
    3030 * containng the utility value of that set of values.
    31  * <p>
    3231 */
    3332@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
     
    4342        /**
    4443         *
    45          * @param issues
     44         * @param issues list of issues
    4645         * @param utils  with keys: list of values and value: utility value for that
    4746         *               list of values. All list-of-values missing from the map are
  • profile/src/main/java/geniusweb/profile/utilityspace/ProductOfValue.java

    r9 r24  
    1919
    2020        /**
    21          * @param values the values to make a product of
     21         * @param newvals the values to make a product of
    2222         */
    2323        @JsonCreator
  • profile/src/main/java/geniusweb/profile/utilityspace/SumOfGroupsUtilitySpace.java

    r10 r24  
    4747
    4848        /**
    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.
    6360         * @throws NullPointerException     if values are incorrectly null.
    6461         * @throws IllegalArgumentException if preconditions not met.
     
    6865                        @JsonProperty("name") String name,
    6966                        @JsonProperty("partUtilities") HashMap<String, PartsUtilities> partutils,
    70                         // @JsonProperty("partWeights") Map<String, BigDecimal> weights,
    7167                        @JsonProperty("reservationBid") Bid resBid) {
    7268                super(name, domain, resBid);
  • profile/src/main/java/geniusweb/profile/utilityspace/ValueSetUtilities.java

    r1 r24  
    55import com.fasterxml.jackson.annotation.JsonSubTypes;
    66import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
     7import com.fasterxml.jackson.annotation.JsonTypeInfo;
    78
    89import geniusweb.issuevalue.Value;
    910import geniusweb.issuevalue.ValueSet;
    10 
    11 import com.fasterxml.jackson.annotation.JsonTypeInfo;
    1211
    1312/**
     
    1615 */
    1716@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) })
    1919public interface ValueSetUtilities {
    2020        /**
    2121         *
    22          * @param value
    23          * @return the utility of the given value. MUST be in [0,1]. Should return 0 if
    24          *         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.
    2525         */
    2626        BigDecimal getUtility(Value value);
     
    2828        /**
    2929         *
    30          * @param values the valueset that
     30         * @param valueset the valueset that is supposed match with this
    3131         * @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 a
    33          *         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.
    3434         */
    3535        String isFitting(ValueSet valueset);
Note: See TracChangeset for help on using the changeset viewer.