Changeset 11 for exampleparties/simpleshaop
- Timestamp:
- 01/30/20 16:52:38 (5 years ago)
- Location:
- exampleparties/simpleshaop
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
exampleparties/simpleshaop/pom.xml
r10 r11 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>simpleshaop</artifactId> 8 <version>1. 0.0</version>8 <version>1.2.0</version> 9 9 <packaging>jar</packaging> 10 10 … … 33 33 <groupId>geniusweb</groupId> 34 34 <artifactId>party</artifactId> 35 <version>1. 1.0</version>35 <version>1.2.0</version> 36 36 </dependency> 37 37 … … 39 39 <groupId>geniusweb</groupId> 40 40 <artifactId>bidspace</artifactId> 41 <version>1. 1.0</version>41 <version>1.2.0</version> 42 42 </dependency> 43 43 <dependency> 44 44 <groupId>geniusweb</groupId> 45 45 <artifactId>profileconnection</artifactId> 46 <version>1. 1.0</version>46 <version>1.2.0</version> 47 47 </dependency> 48 48 <dependency> -
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 -
exampleparties/simpleshaop/src/test/java/geniusweb/exampleparties/simpleshaop/SimpleLinearOrderingTest.java
r10 r11 64 64 SimpleLinearOrdering testprofile = new SimpleLinearOrdering( 65 65 realprofile); 66 assertEquals(Arrays.asList(bid 3, bid2, bid1), testprofile.getBids());66 assertEquals(Arrays.asList(bid1, bid2, bid3), testprofile.getBids()); 67 67 } 68 68
Note:
See TracChangeset
for help on using the changeset viewer.