Changeset 11 for exampleparties/simpleshaop/src/main/java
- Timestamp:
- 01/30/20 16:52:38 (5 years ago)
- Location:
- exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop/ShaopParty.java
r10 r11 15 15 import geniusweb.actions.Offer; 16 16 import geniusweb.actions.PartyId; 17 import geniusweb.bidspace.All PartialBidsList;17 import geniusweb.bidspace.AllBidsList; 18 18 import geniusweb.issuevalue.Bid; 19 19 import geniusweb.party.Capabilities; … … 132 132 133 133 private Offer randomBid() throws IOException { 134 All PartialBidsList bidspace = new AllPartialBidsList(134 AllBidsList bidspace = new AllBidsList( 135 135 profileint.getProfile().getDomain()); 136 136 long i = random.nextInt(bidspace.size().intValue()); -
exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop/SimpleLinearOrdering.java
r10 r11 94 94 DefaultPartialOrdering prof = (DefaultPartialOrdering) profile; 95 95 List<Bid> bidslist = prof.getBids(); 96 // NOTE sort defaults to ascending order, this is missing in docs. 96 97 Collections.sort(bidslist, new Comparator<Bid>() { 97 98 98 99 @Override 99 100 public int compare(Bid b1, Bid b2) { 100 // notice, -1 if better because WORST bid first 101 return prof.isPreferredOrEqual(b1, b2) ? -1 : 1; 101 return prof.isPreferredOrEqual(b1, b2) ? 1 : -1; 102 102 } 103 103
Note:
See TracChangeset
for help on using the changeset viewer.