Changeset 8 for bidspace/src/main/java
- Timestamp:
- 09/30/19 15:37:05 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bidspace/src/main/java/geniusweb/bidspace/BidsWithUtility.java
r4 r8 25 25 * values to accelerate the calls and subsequent calls. Re-use the object to 26 26 * keep/reuse the cache. 27 * <h1>Rounding</h1> Internally, utilities of bids are rounded to the given 28 * precision. This may cause inclusion/exclusion of some bids in the results. 29 * See {@link #BidsWithUtility(LinearAdditiveUtilitySpace, int)} for more 30 * details 27 31 */ 28 32 public class BidsWithUtility { … … 52 56 * 53 57 * @param space the {@link LinearAdditiveUtilitySpace} to analyze 54 * @param precision the number of digits to use for computations. This value 55 * should match the max number of (digits used in the 56 * weight of an issue + number of digits used in the issue 57 * utility). Usually you also look at the step size, and 58 * the range of interest. For instance if your utility 59 * function has values 1/3 and 2/3, then these have an 60 * 'infinite' number of relevant digits. But if we want to 61 * search bids between utility 0.1 and 0.2, then computing 62 * in 2 digits might already be sufficient. This algorithm 63 * has memory and space complexity O( |nissues| 64 * 10^precision ). For spaces up to 7 issues, 7 digits 65 * should be feasible; for 9 issues, 6 digits may be the 66 * maximum. 58 * @param precision the number of digits to use for computations. In 59 * practice, 6 seems a good default value. 60 * <p> 61 * All utilities * weight are rounded to this number of 62 * digits. This value should match the max number of 63 * (digits used in the weight of an issue + number of 64 * digits used in the issue utility). To determine the 65 * optimal value, one may consider the step size of the 66 * issues, and the range of interest. For instance if the 67 * utility function has values 1/3 and 2/3, then these have 68 * an 'infinite' number of relevant digits. But if the goal 69 * is to search bids between utility 0.1 and 0.2, then 70 * computing in 2 digits might already be sufficient. 71 * <p> 72 * This algorithm has memory and space complexity O( 73 * |nissues| 10^precision ). For spaces up to 7 issues, 7 74 * digits should be feasible; for 9 issues, 6 digits may be 75 * the maximum. 76 * <p> 77 * 67 78 */ 68 79 public BidsWithUtility(LinearAdditiveUtilitySpace space, int precision) { … … 88 99 89 100 /** 90 * @return the utility {@link Interval} of this space: minimum and maximum91 * achievable utility.101 * @return the (rounded) utility {@link Interval} of this space: minimum and 102 * maximum achievable utility. 92 103 */ 93 104 public Interval getRange() { … … 99 110 * @param range the minimum and maximum utility required of the bids. to be 100 111 * included (both ends inclusive). 101 * @return a list with bids that have utility inside range. possibly empty. 102 * With decreasing precision, more bids may drop out due to rounding 103 * errors. 112 * @return a list with bids that have a (rounded) utility inside range. 113 * possibly empty. 104 114 */ 105 115 public ImmutableList<Bid> getBids(Interval range) {
Note:
See TracChangeset
for help on using the changeset viewer.