Changeset 18
- Timestamp:
- 09/22/20 16:26:52 (4 years ago)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pom.xml
r17 r18 7 7 <artifactId>runserver</artifactId> 8 8 <packaging>war</packaging> 9 <version>1.5. 0</version> <!-- must equal ${geniusweb.version} -->9 <version>1.5.1</version> <!-- must equal ${geniusweb.version} --> 10 10 <name>runserver Maven Webapp</name> 11 11 <url>http://maven.apache.org</url> … … 20 20 <jackson-2-version>2.9.10</jackson-2-version> 21 21 <tomcat.version>8.0.53</tomcat.version> 22 <geniusweb.version>1.5. 0</geniusweb.version>22 <geniusweb.version>1.5.1</geniusweb.version> 23 23 </properties> 24 24 -
src/main/webapp/newsession.xhtml
r17 r18 40 40 <br /> Domain/Profile Server: 41 41 <input type="url" name="url" id="profilesserverurl" 42 value="localhost:8080/profilesserver-1.5. 0"42 value="localhost:8080/profilesserver-1.5.1" 43 43 pattern=".*:[0-9]+/profilesserver" size="30" 44 44 onchange="connectDomain()"> </input> … … 54 54 <br /> <b>Participants</b> <br /> Parties Server: <input type="url" 55 55 name="url" id="partiesserverurl" 56 value="localhost:8080/partiesserver-1.5. 0"56 value="localhost:8080/partiesserver-1.5.1" 57 57 pattern=".*:[0-9]+/partiesserver" size="30" 58 58 onchange="connectParties()"> </input> <br /> <br /> <b>Party … … 294 294 refresh table: copy all parties elements in there. 295 295 Typically parties is something like 296 [{"uri":"http:130.161.180.1:8080/partiesserver/run/randomparty-1.5. 0",296 [{"uri":"http:130.161.180.1:8080/partiesserver/run/randomparty-1.5.1", 297 297 "capabilities":{"protocols":["SAOP"]}, 298 298 "description":"places random bids until it can accept an offer with utility >0.6", 299 "id":"randomparty-1.5. 0",299 "id":"randomparty-1.5.1", 300 300 "partyClass":"geniusweb.exampleparties.randomparty.RandomParty"}, 301 301 ...] … … 632 632 function init() { 633 633 selectProtocol(); 634 document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.5. 0"635 document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.5. 0"634 document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.5.1" 635 document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.5.1" 636 636 connectDomain(); 637 637 connectParties(); -
src/main/webapp/newtournament.xhtml
r17 r18 585 585 */ 586 586 function init() { 587 document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.5. 0";588 document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.5. 0";587 document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.5.1"; 588 document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.5.1"; 589 589 590 590 selectProtocol(); -
src/main/webapp/plotlog.xhtml
r17 r18 91 91 } else if (json['SHAOPState']!=undefined) { 92 92 processSHAOP(json['SHAOPState']); 93 } else { 93 } else if (json['MOPACState']!=undefined) { 94 // just use the SAOP processor, which shows the 95 // utilities of all Offers in sequence. 96 processSAOP(json['MOPACState']); 97 } else{ 94 98 setStatus("Unknown log file contents "+Object.keys(json)); 95 99 } -
src/main/webapp/utilstable.xhtml
r16 r18 28 28 <tr> 29 29 <th align="center">run nr</th> 30 <th align="center">accepted bid </th>30 <th align="center">accepted bid(s)</th> 31 31 <th align="center">party utility - penalty</th> 32 32 </tr> … … 212 212 } 213 213 214 215 214 /** 215 @return true if object1, object2 are 'deep equal'. That means, 216 if they are dicts then we check that the keys and their values are equal, 217 recursively. 218 */ 219 function deepEqual(object1, object2) { 220 const keys1 = Object.keys(object1); 221 const keys2 = Object.keys(object2); 222 223 if (keys1.length !== keys2.length) { 224 return false; 225 } 226 227 for (const key of keys1) { 228 const val1 = object1[key]; 229 const val2 = object2[key]; 230 const areObjects = isObject(val1) && isObject(val2); 231 if ( 232 areObjects && !deepEqual(val1, val2) || !areObjects && val1 !== val2 233 ) { 234 return false; 235 } 236 } 237 238 return true; 239 } 240 241 function isObject(object) { 242 return object != null && typeof object === 'object'; 243 } 244 245 /** 246 @param list the list to add value to 247 @param value the value to add 248 @return list with the value added, but only if not already in list. 249 Uses deepEqual to check equality of list members 250 */ 251 function addSet(list, value) { 252 for (const v of list) { 253 if (deepEqual(v, value)) 254 return list; 255 } 256 return list.concat(value); 257 } 216 258 217 259 /** … … 219 261 @param nr the row number 220 262 @param result a single json result from the APP results section. 221 Contains participants, agreement and error263 Contains participants, agreements and error 222 264 */ 223 265 function fillRow(row, nr, result) { … … 234 276 } 235 277 236 var agreedbid = result['agreement']; 237 row.insertCell(-1).innerHTML = (agreedbid==null?"none":JSON.stringify(agreedbid['issuevalues'])); 238 if (agreedbid==null) agreedbid = {}; 239 else agreedbid = agreedbid['issuevalues']; 278 // collect unique bids in agreements. 279 var agreements = result['agreements']; 280 var bids = []; 281 for (const pid in agreements) { 282 bids=addSet(bids, agreements[pid]['issuevalues']); 283 } 284 285 286 // a dict, keys are party ids. 287 // FIXME this does not work ok with MOPAC. 288 row.insertCell(-1).innerHTML = JSON.stringify(bids); 289 var agreedbid={}; 290 if (bids.length>0) agreedbid = bids[0]; 240 291 241 292 // fill in the columns. If SHAOP, only the even parties
Note:
See TracChangeset
for help on using the changeset viewer.