Changeset 20 for exampleparties/timedependentparty/src
- Timestamp:
- 08/05/20 09:42:15 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java
r18 r20 126 126 127 127 Action myAction; 128 if (bid == null || lastReceivedBid != null128 if (bid == null || (lastReceivedBid != null 129 129 && utilspace.getUtility(lastReceivedBid) 130 .compareTo(utilspace.getUtility(bid)) >= 0) {130 .compareTo(utilspace.getUtility(bid)) >= 0)) { 131 131 // if bid==null we failed to suggest next bid. 132 132 myAction = new Accept(me, lastReceivedBid); … … 155 155 BigDecimal utilityGoal = utilityGoal(time, getE()); 156 156 ImmutableList<Bid> options = extendedspace.getBids(utilityGoal); 157 if (options.size() == BigInteger.ZERO) 158 return null; 157 if (options.size() == BigInteger.ZERO) { 158 // if we can't find good bid, get max util bid.... 159 options = extendedspace.getBids(extendedspace.getMax()); 160 } 159 161 // pick a random one. 160 162 return options.get(new Random().nextInt(options.size().intValue()));
Note:
See TracChangeset
for help on using the changeset viewer.