static class ShortestPercentiles {
new TreeMap<Long, S> map;
// assumes score is between 0 and 100
bool update(S desc, double score) {
long p = (long) min(100, max(0, Math.floor(score)));
S old = map.get(p);
if (old == null || l(old) < l(desc)) {
map.put(p, desc);
print("New best in percentile \*p*/: " + l(desc));
// TODO: clear lower ones where new code is also shorter
true;
}
false;
}
}Began life as a copy of #1004717
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1004730 |
| Snippet name: | ShortestPercentiles - collect shortest code for various accuracy scores |
| Eternal ID of this version: | #1004730/1 |
| Text MD5: | be3fb6477e4fd556e3bb52960c7a8c28 |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2016-08-28 16:49:37 |
| Source code size: | 459 bytes / 16 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 1011 / 1604 |
| Referenced in: | #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674) |