Changeset 3 for exampleparties/timedependentparty
- Timestamp:
- 08/29/19 17:09:32 (5 years ago)
- Location:
- exampleparties/timedependentparty/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java
r2 r3 122 122 123 123 if (lastReceivedBid != null && utilspace.getUtility(lastReceivedBid) 124 .compareTo(utilspace.getUtility(bid)) > 0) {124 .compareTo(utilspace.getUtility(bid)) >= 0) { 125 125 myAction = new Accept(me, lastReceivedBid); 126 126 } else { … … 160 160 maxUtil = util; 161 161 } 162 double rv = utilspace.getUtility(utilspace.getReservationBid()) 163 .doubleValue(); 164 if (rv > minUtil) 165 minUtil = rv; 162 163 Bid rvbid = utilspace.getReservationBid(); 164 if (rvbid != null) { 165 double rv = utilspace.getUtility(rvbid).doubleValue(); 166 if (rv > minUtil) 167 minUtil = rv; 168 } 166 169 tolerance = 100 / allbidslist.size().longValue(); 167 170 tolerance = Math.max(tolerance, 0.1); -
exampleparties/timedependentparty/src/test/java/geniusweb/exampleparties/timedependentparty/TimeDependentPartyTest.java
r2 r3 27 27 import com.fasterxml.jackson.databind.ObjectMapper; 28 28 29 import geniusweb.actions.Accept; 29 30 import geniusweb.actions.Action; 30 31 import geniusweb.actions.EndNegotiation; … … 146 147 } 147 148 148 //@Test149 //public void testAgentAccepts() {150 //party.connect(connection);151 //party.notifyChange(settings);152 // 153 //Bid bid = findBestBid();154 //party.notifyChange(new ActionDone(new Offer(otherparty, bid)));155 //party.notifyChange(new YourTurn());156 //assertEquals(1, connection.getActions().size());157 //assertTrue(connection.getActions().get(0) instanceof Accept);158 // 159 //}149 @Test 150 public void testAgentAccepts() { 151 party.connect(connection); 152 party.notifyChange(settings); 153 154 Bid bid = findBestBid(); 155 party.notifyChange(new ActionDone(new Offer(otherparty, bid))); 156 party.notifyChange(new YourTurn()); 157 assertEquals(1, connection.getActions().size()); 158 assertTrue(connection.getActions().get(0) instanceof Accept); 159 160 } 160 161 161 162 @Test
Note:
See TracChangeset
for help on using the changeset viewer.