Changeset 20
- Timestamp:
- 08/05/20 09:42:15 (4 years ago)
- Files:
-
- 75 added
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
bidspace/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>bidspace</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <passwd>${env.ARTIFACTORY_PASS}</passwd> 17 17 <jackson-2-version>2.9.10</jackson-2-version> 18 <geniusweb.version>1.4. 2</geniusweb.version>18 <geniusweb.version>1.4.4</geniusweb.version> 19 19 </properties> 20 20 -
events/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>events</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/anac2019/agentgg/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties.anac2019</groupId> 7 7 <artifactId>agentgg</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/anac2019/winkyagent/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties.anac2019</groupId> 7 7 <artifactId>winkyagent</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/boulware/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>boulware</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 … … 34 34 <groupId>geniusweb.exampleparties</groupId> 35 35 <artifactId>timedependentparty</artifactId> 36 <version> 1.4.1</version> <!-- must equal ${geniusweb.version} -->36 <version>${geniusweb.version}</version> 37 37 </dependency> 38 38 <dependency> -
exampleparties/comparebids/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>comparebids</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/conceder/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>conceder</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/hardliner/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>hardliner</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/humangui/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>humangui</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/linear/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>linear</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/pom.xml
r12 r20 27 27 <module>comparebids</module> 28 28 <module>anac2019</module> 29 <module>simpleboa</module> 29 30 </modules> 30 31 </project> -
exampleparties/randomparty/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>randomparty</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/randompartypy/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>randompyparty</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/simpleshaop/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>simpleshaop</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
exampleparties/timedependentparty/pom.xml
r19 r20 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>timedependentparty</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
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())); -
issuevalue/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>issuevalue</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
opponentmodel/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>opponentmodel</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
opponentmodel/src/main/java/geniusweb/opponentmodel/FrequencyOpponentModel.java
r18 r20 24 24 * (as you might expect as {@link NumberValueSetUtilities} is only affected by 25 25 * the endpoints). 26 * 26 * <p> 27 * immutable. 27 28 */ 28 29 public class FrequencyOpponentModel implements UtilitySpace, OpponentModel { 29 30 30 31 private static final int DECIMALS = 4; // accuracy of our computations. 32 private static int serial = 1; // counter for auto name generation 33 31 34 private final Domain domain; 32 35 private final Map<String, Map<Value, Integer>> bidFrequencies; 33 36 private final BigDecimal totalBids; 34 private static int serial = 1; // counter for auto name generation 35 36 public FrequencyOpponentModel(Domain domain) { 37 /* 38 * simply reset the whole model and make a new one... maybe this can be 39 * done smarter for minor changes? map with empth hashmap for each 40 * issue. 41 */ 42 this(domain, 37 38 public FrequencyOpponentModel() { 39 this.domain = null; 40 this.bidFrequencies = null; 41 this.totalBids = BigDecimal.ZERO; 42 } 43 44 @Override 45 public FrequencyOpponentModel with(Domain domain, Bid resBid) { 46 // FIXME merge already available frequencies? 47 return new FrequencyOpponentModel(domain, 43 48 domain.getIssues().stream().collect( 44 49 Collectors.toMap(iss -> iss, iss -> new HashMap<>())), … … 115 120 } 116 121 117 /**118 * {@inheritDoc}119 *120 * <h1>change info</h1> This replaces update(Bid). Now you pass the entire121 * action and the progress instead of just the bid.122 */123 122 @Override 124 123 public FrequencyOpponentModel with(Action action, Progress progress) { … … 127 126 128 127 Bid bid = ((Offer) action).getBid(); 129 String err = domain.isComplete(bid);130 if (err != null) {131 throw new IllegalArgumentException(err);132 }133 128 Map<String, Map<Value, Integer>> newFreqs = cloneMap(bidFrequencies); 134 129 for (String issue : domain.getIssues()) { 135 130 Map<Value, Integer> freqs = newFreqs.get(issue); 136 131 Value value = bid.getValue(issue); 137 Integer oldfreq = freqs.get(value); 138 if (oldfreq == null) { 139 oldfreq = 0; 132 if (value != null) { 133 Integer oldfreq = freqs.get(value); 134 if (oldfreq == null) { 135 oldfreq = 0; 136 } 137 freqs.put(value, oldfreq + 1); 140 138 } 141 freqs.put(value, oldfreq + 1);142 139 } 143 140 -
opponentmodel/src/main/java/geniusweb/opponentmodel/OpponentModel.java
r18 r20 2 2 3 3 import geniusweb.actions.Action; 4 import geniusweb.issuevalue.Bid; 4 5 import geniusweb.issuevalue.Domain; 5 6 import geniusweb.profile.Profile; … … 13 14 * Domain as argument. unfortunately this can not be enforced in a java 14 15 * interface 16 * 17 * <p> 18 * <em>MUST</em> have an empty constructor as these are also used as part of the 19 * BOA framework. 20 * 15 21 */ 16 22 public interface OpponentModel extends Profile { 23 24 /** 25 * Initializes the model. This function must be called first after 26 * constructing an instance. It can also be called later, if there is a 27 * change in the domain or resBid. 28 * 29 * @param domain the domain to work with 30 * @param resBid the reservation bid, or null if no reservationbid is 31 * available. 32 * @return OpponentModel that uses given domain and reservationbid. 33 * 34 */ 35 OpponentModel with(Domain domain, Bid resBid); 17 36 18 37 /** -
opponentmodel/src/test/java/geniusweb/profile/opponentmodel/FrequencyOppModelTest.java
r18 r20 87 87 bid3 = new Bid(issuevalues); 88 88 89 oppModel1 = new FrequencyOpponentModel( domain);90 oppModel1b = new FrequencyOpponentModel( domain);91 oppModel2 = new FrequencyOpponentModel( domain2);92 oppModel3 = new FrequencyOpponentModel( domain3);89 oppModel1 = new FrequencyOpponentModel().with(domain, null); 90 oppModel1b = new FrequencyOpponentModel().with(domain, null); 91 oppModel2 = new FrequencyOpponentModel().with(domain2, null); 92 oppModel3 = new FrequencyOpponentModel().with(domain3, null); 93 93 oppModel4 = oppModel3.with(new Offer(other, bid1), progress); 94 94 … … 113 113 @Test(expected = NullPointerException.class) 114 114 public void smokeTestNull() { 115 new FrequencyOpponentModel( null);115 new FrequencyOpponentModel().with((Domain) null, null); 116 116 } 117 117 118 118 @Test 119 119 public void smokeTest() { 120 new FrequencyOpponentModel( domain);120 new FrequencyOpponentModel().with(domain, null); 121 121 } 122 122 123 123 @Test 124 124 public void testEmptyModel() { 125 FrequencyOpponentModel oppModel = new FrequencyOpponentModel(domain); 125 FrequencyOpponentModel oppModel = new FrequencyOpponentModel() 126 .with(domain, null); 126 127 assertEquals(BigDecimal.ONE, oppModel.getUtility(bid1)); 127 128 assertEquals(BigDecimal.ONE, oppModel.getUtility(bid2)); … … 153 154 } 154 155 156 @Test 157 public void testPartialBidUpdate() { 158 FrequencyOpponentModel oppModel = oppModel1.with(new Offer(other, bid1), 159 progress); 160 Bid partialbid = new Bid(ISS1, I1V1); 161 oppModel.with(new Offer(other, partialbid), progress); 162 } 163 155 164 } -
party/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>party</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
pom.xml
r14 r20 30 30 <module>simplerunner</module> 31 31 <module>opponentmodel</module> 32 <module>boa</module> 32 33 </modules> 33 34 </project> -
profile/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>profile</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
profile/src/test/java/geniusweb/profile/utilityspace/LinearAdditiveSerializationTest.java
r7 r20 27 27 28 28 public class LinearAdditiveSerializationTest { 29 29 30 private static final BigDecimal VAL2 = new BigDecimal("0.2"); 30 31 private static final BigDecimal VAL3 = new BigDecimal("0.3"); … … 106 107 @Test 107 108 public void testSerialize() throws JsonProcessingException { 108 ObjectMapper jackson = new ObjectMapper();109 109 String string = jackson.writeValueAsString(space); 110 110 System.out.println(string); … … 114 114 @Test 115 115 public void testDeserialize() throws IOException { 116 ObjectMapper jackson = new ObjectMapper();117 116 assertEquals(space, jackson.readValue(serialized, Profile.class)); 118 117 } … … 120 119 @Test(expected = InvalidDefinitionException.class) 121 120 public void testDeserializeWrongIssues() throws IOException { 122 ObjectMapper jackson = new ObjectMapper();123 121 jackson.readValue(serializedWrongIssues, Profile.class); 124 122 } -
profileconnection/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>profileconnection</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
profileconnection/src/main/java/geniusweb/profileconnection/WebsocketProfileConnector.java
r11 r20 49 49 this.uri = uri; 50 50 this.logger = reporter; 51 // see #1763 expected max size of profiles. 52 wscontainer.setDefaultMaxTextMessageBufferSize(200000); 51 53 wscontainer.connectToServer(this, uri); 52 54 } -
protocol/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>protocol</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
protocol/src/main/java/geniusweb/protocol/session/SessionState.java
r11 r20 65 65 */ 66 66 Bid getAgreement(); 67 68 /** 69 * 70 * @return the {@link SessionResult}. Assumes {@link #isFinal(long)}. result 71 * may be undefined if not. 72 */ 73 SessionResult getResult(); 67 74 } -
protocol/src/main/java/geniusweb/protocol/session/saop/SAOPState.java
r10 r20 19 19 import geniusweb.protocol.partyconnection.ProtocolToPartyConnections; 20 20 import geniusweb.protocol.session.DefaultSessionState; 21 import geniusweb.protocol.session.SessionResult; 21 22 import geniusweb.protocol.session.SessionSettings; 22 23 import geniusweb.references.PartyWithProfile; … … 248 249 } 249 250 251 @Override 252 public SessionResult getResult() { 253 List<Double> emptylist = new LinkedList<>(); 254 for (int n = 0; n < getConnections().size(); n++) 255 emptylist.add(0d); 256 return new SessionResult(getSettings().getAllParties(), getAgreement(), 257 emptylist, getError()); 258 } 259 250 260 } -
protocol/src/main/java/geniusweb/protocol/session/shaop/BareSHAOPState.java
r18 r20 1 1 package geniusweb.protocol.session.shaop; 2 2 3 import java.util.Arrays; 3 4 import java.util.Collections; 4 5 import java.util.LinkedList; … … 13 14 import geniusweb.protocol.ProtocolException; 14 15 import geniusweb.protocol.partyconnection.ProtocolToPartyConnections; 16 import geniusweb.protocol.session.SessionResult; 15 17 import geniusweb.protocol.session.SessionSettings; 16 18 import geniusweb.protocol.session.SessionState; … … 169 171 170 172 @Override 173 public SessionResult getResult() { 174 Double[] penalties = new Double[partyNumbers.size()]; 175 for (PartyId party : partyNumbers.keySet()) { 176 Double spent = totalSpent.get(party); 177 if (spent == null) { 178 spent = 0d; 179 } else { 180 spent = Math.max(0, Math.min(1.0, spent)); 181 } 182 penalties[partyNumbers.get(party)] = spent; 183 } 184 return new SessionResult(getSettings().getAllParties(), getAgreement(), 185 Arrays.asList(penalties), getError()); 186 187 } 188 189 @Override 171 190 public int hashCode() { 172 191 final int prime = 31; -
protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsProtocol.java
r10 r20 6 6 import geniusweb.events.TournamentStarted; 7 7 import geniusweb.protocol.CurrentNegoState; 8 import geniusweb.protocol.SessionResult;9 8 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory; 10 9 import geniusweb.protocol.session.SessionProtocol; 10 import geniusweb.protocol.session.SessionResult; 11 11 import geniusweb.protocol.session.SessionSettings; 12 12 import geniusweb.protocol.session.SessionState; … … 83 83 // List<TeamOfPartiesAndProfiles> participants = 84 84 // sessionstate.getSettings().getParticipants() 85 SessionResult result = new SessionResult( 86 sessionstate.getSettings().getAllParties(), 87 sessionstate.getAgreement(), sessionstate.getError()); 85 SessionResult result = sessionstate.getResult(); 88 86 state = state.with(result); 89 87 notifyListeners(new CurrentNegoState(state)); -
protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsState.java
r10 r20 6 6 7 7 import geniusweb.protocol.ProtocolException; 8 import geniusweb.protocol. SessionResult;8 import geniusweb.protocol.session.SessionResult; 9 9 import geniusweb.protocol.session.SessionSettings; 10 10 import geniusweb.protocol.tournament.TournamentState; -
protocol/src/test/java/geniusweb/protocol/session/DefaultSessionStateTest.java
r10 r20 139 139 } 140 140 141 @Override 142 public SessionResult getResult() { 143 144 List<Double> emptylist = new LinkedList<>(); 145 for (int n = 0; n < getConnections().size(); n++) 146 emptylist.add(0d); 147 return new SessionResult(getSettings().getAllParties(), getAgreement(), 148 emptylist, getError()); 149 150 } 151 141 152 } -
protocol/src/test/java/geniusweb/protocol/session/SessionResultTest.java
r8 r20 19 19 import geniusweb.issuevalue.DiscreteValue; 20 20 import geniusweb.issuevalue.Value; 21 import geniusweb.protocol.SessionResult;22 21 import geniusweb.references.Parameters; 23 22 import geniusweb.references.PartyRef; … … 32 31 33 32 private final String ISSUE1 = "issue1"; 34 private SessionResult result1, result1a, result2, result3 ;//, result4;33 private SessionResult result1, result1a, result2, result3, result4; 35 34 private String errorstring; // created dynamically: eclipse and maven 36 35 // generate different stacktrace. 37 private String jsonstring = "{\"participants\":[{\"party\":{\"partyref\":\"party1\",\"parameters\":{}},\"profile\":\"profile1\"},{\"party\":{\"partyref\":\"party2\",\"parameters\":{}},\"profile\":\"profile2\"}],\"agreement\":{\"issuevalues\":{\"issue1\":\"a\"}},\"error\":null}"; 36 private String jsonstring = "{\"participants\":[{\"party\":{\"partyref\":\"party1\",\"parameters\":{}},\"profile\":\"profile1\"},{\"party\":{\"partyref\":\"party2\",\"parameters\":{}},\"profile\":\"profile2\"}],\"agreement\":{\"issuevalues\":{\"issue1\":\"a\"}},\"penalties\":[0.0,0.0],\"error\":null}"; 37 private List<Double> nopenalties = Arrays.asList(0d, 0d); 38 private List<Double> penalties = Arrays.asList(0.1d, 0.2d); 38 39 39 40 @Before … … 63 64 64 65 result1 = new SessionResult(Arrays.asList(partyprofile1, partyprofile2), 65 bid1, n ull);66 bid1, nopenalties, null); 66 67 result1a = new SessionResult( 67 Arrays.asList(partyprofile1, partyprofile2), bid1, null); 68 Arrays.asList(partyprofile1, partyprofile2), bid1, nopenalties, 69 null); 68 70 result2 = new SessionResult(Arrays.asList(partyprofile1, partyprofile2), 69 bid2, n ull);71 bid2, nopenalties, null); 70 72 result3 = new SessionResult(Arrays.asList(partyprofile2, partyprofile1), 71 bid2, null); 73 bid2, nopenalties, null); 74 result4 = new SessionResult(Arrays.asList(partyprofile2, partyprofile1), 75 bid2, penalties, null); 76 72 77 // IGNORE ERROR for now, it fails somewhere deep in maven suddenly. 73 78 // result4 = new SessionResult(Arrays.asList(partyprofile1, … … 78 83 public List<List<SessionResult>> getGeneralTestData() { 79 84 return Arrays.asList(Arrays.asList(result1, result1a), 80 Arrays.asList(result2), Arrays.asList(result3) 81 // ,Arrays.asList(result4) 82 ); 85 Arrays.asList(result2), Arrays.asList(result3), 86 Arrays.asList(result4)); 83 87 } 84 88 … … 86 90 public List<String> getGeneralTestStrings() { 87 91 return Arrays.asList( 88 "SessionResult.*party1.*profile1.*,.*party2.*profile2.*Bid.*issue1=\"a\".* null.",89 "SessionResult.*party1.*profile1.*,.*party2.*profile2.*Bid.*issue1=\"b\".* null.*",90 "SessionResult.*party2.*profile2.*,.*party1.*profile1.*Bid.*issue1=\"b\".* null.*"91 // ,"SessionResult.*party1.*profile1.*,.*party2.*profile2.*Bid.*issue1=\"a\".*null.*"92 "SessionResult.*party1.*profile1.*,.*party2.*profile2.*Bid.*issue1=\"a\".*0\\.0.*0\\.0.*null.*", 93 "SessionResult.*party1.*profile1.*,.*party2.*profile2.*Bid.*issue1=\"b\".*0\\.0.*0\\.0.*null.*", 94 "SessionResult.*party2.*profile2.*,.*party1.*profile1.*Bid.*issue1=\"b\".*0\\.0.*0\\.0.*null.*", 95 "SessionResult.*party2.*profile2.*,.*party1.*profile1.*Bid.*issue1=\"b\".*0\\.1.*0\\.2.*null.*" 92 96 93 97 ); -
protocol/src/test/java/geniusweb/protocol/session/shaop/SHAOPStateTest.java
r18 r20 31 31 import geniusweb.protocol.partyconnection.ProtocolToPartyConn; 32 32 import geniusweb.protocol.partyconnection.ProtocolToPartyConnections; 33 import geniusweb.protocol.session.SessionResult; 33 34 import geniusweb.protocol.session.TeamOfPartiesAndProfiles; 34 35 import tudelft.utilities.junit.GeneralTests; … … 314 315 } 315 316 317 @Test 318 public void getResultTest() { 319 320 Map<PartyId, Double> spent = new HashMap<>(); 321 spent.put(party1, 0.1d); 322 SHAOPState state = new SHAOPState(actions, connections4, 323 new ProgressRounds(10, 0, null), settings, null, 0, partynrs, 324 spent); 325 SessionResult res = state.getResult(); 326 327 } 328 316 329 } -
protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsProtocolTest.java
r10 r20 23 23 import geniusweb.protocol.CurrentNegoState; 24 24 import geniusweb.protocol.NegoState; 25 import geniusweb.protocol.SessionResult;26 25 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory; 27 26 import geniusweb.protocol.session.SessionProtocol; 27 import geniusweb.protocol.session.SessionResult; 28 28 import geniusweb.protocol.session.SessionSettings; 29 29 import geniusweb.protocol.session.SessionState; … … 46 46 private Bid agreement = mock(Bid.class); 47 47 private final long NOW = 1000; 48 private SessionResult finalstate = mock(SessionResult.class); 48 49 49 50 @Before … … 53 54 when(finalsessionstate.getSettings()).thenReturn(settings); 54 55 when(finalsessionstate.getAgreement()).thenReturn(agreement); 56 when(finalsessionstate.getResult()).thenReturn(finalstate); 57 when(finalstate.getAgreement()).thenReturn(agreement); 55 58 when(state.with(any())).thenReturn(newstate); 56 59 } -
protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsStateTest.java
r10 r20 13 13 import org.junit.Test; 14 14 15 import geniusweb.protocol. SessionResult;15 import geniusweb.protocol.session.SessionResult; 16 16 import geniusweb.protocol.session.SessionSettings; 17 17 import geniusweb.references.PartyWithProfile; -
pythonadapter/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>pythonadapter</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
references/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>references</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
simplerunner/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>simplerunner</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4. 2</geniusweb.version>19 <geniusweb.version>1.4.4</geniusweb.version> 20 20 </properties> 21 21 -
timeline/pom.xml
r19 r20 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>timeline</artifactId> 8 <version>1.4. 2</version> <!-- must equal ${geniusweb.version} -->8 <version>1.4.4</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <passwd>${env.ARTIFACTORY_PASS}</passwd> 17 17 <jackson-2-version>2.9.10</jackson-2-version> 18 <geniusweb.version>1.4. 2</geniusweb.version>18 <geniusweb.version>1.4.4</geniusweb.version> 19 19 </properties> 20 20
Note:
See TracChangeset
for help on using the changeset viewer.