Ignore:
Timestamp:
08/05/20 09:42:15 (4 years ago)
Author:
bart
Message:

Added BOA support, some bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java

    r18 r20  
    126126
    127127                Action myAction;
    128                 if (bid == null || lastReceivedBid != null
     128                if (bid == null || (lastReceivedBid != null
    129129                                && utilspace.getUtility(lastReceivedBid)
    130                                                 .compareTo(utilspace.getUtility(bid)) >= 0) {
     130                                                .compareTo(utilspace.getUtility(bid)) >= 0)) {
    131131                        // if bid==null we failed to suggest next bid.
    132132                        myAction = new Accept(me, lastReceivedBid);
     
    155155                BigDecimal utilityGoal = utilityGoal(time, getE());
    156156                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                }
    159161                // pick a random one.
    160162                return options.get(new Random().nextInt(options.size().intValue()));
Note: See TracChangeset for help on using the changeset viewer.