Changeset 16 for src/main/webapp/utilstable.xhtml
- Timestamp:
- 08/05/20 09:42:31 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/webapp/utilstable.xhtml
r14 r16 29 29 <th align="center">run nr</th> 30 30 <th align="center">accepted bid</th> 31 <th align="center">party utilit ies</th>31 <th align="center">party utility - penalty</th> 32 32 </tr> 33 33 </thead> … … 37 37 38 38 </table> 39 40 41 39 </body> 42 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 43 56 <!-- Script to get/update the table using the query given in the URL. --> 44 57 <script type="application/javascript"> 45 58 46 59 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 60 63 61 … … 227 225 228 226 if (result['error']!=null) { 229 row.insertCell(-1).innerHTML="session failed with error"; 227 var errstr="session failed:"; 228 var err=result['error']; 229 if ("geniusweb.protocol.ProtocolException" in err) { 230 errstr=errstr+err["geniusweb.protocol.ProtocolException"]['cause']['message']; 231 } 232 row.insertCell(-1).innerHTML=errstr; 230 233 return; 231 234 } … … 241 244 var party = result['participants'][n] 242 245 var profile =party['profile']; 246 var penalty=result['penalties'][n]; 243 247 // make short name for readability 244 248 var partyname = party['party']['partyref']; 245 249 partyname = partyname.split('/'); 246 250 partyname = partyname[partyname.length-1]; 247 addUtilityCell(row.insertCell(-1), agreedbid, partyname, profile );251 addUtilityCell(row.insertCell(-1), agreedbid, partyname, profile,penalty); 248 252 } 249 253 } … … 255 259 @param profileurl the profile url to use for the evaluation of the bid 256 260 @param bid the accepted bid, not null. 257 */ 258 function addUtilityCell(cell, agreedbid, partyname, profileurl) { 261 @param penalty costs made by the party, to be subtracted from total util. 262 typically these are elicitation costs. 263 */ 264 function addUtilityCell(cell, agreedbid, partyname, profileurl, penalty) { 259 265 var util = utility(profiles[profileurl],agreedbid); 260 cell.innerHTML = Math.round(util*1000000)/1000000 +" :"+partyname; 266 var rUtil = Math.round(util*1000000)/1000000; 267 var rPenalty = Math.round( (penalty )*1000000)/1000000 ; 268 cell.innerHTML = rUtil + "-" + rPenalty + " :"+partyname; 261 269 262 270 }
Note:
See TracChangeset
for help on using the changeset viewer.