| 1 | // returns optimized specimen, score | 
| 2 | static <A> Pair<A, Double> racerOptimize(RandomAndVary<A> r, F1<A, Double> scorer, O... _) {
 | 
| 3 | new AIStrategy_Racer_RandomWithVary<A> strategy; | 
| 4 | strategy.submit = scorer; | 
| 5 |   strategy.random = func -> A { r.randomInstance() };
 | 
| 6 |   strategy.vary = func(A a) -> A { r.varyInstance(a) };
 | 
| 7 | ret bestAsPair(runStrategyWhileImprovement(strategy, _)); | 
| 8 | } | 
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1022938 | 
| Snippet name: | racerOptimize - optmization with "Racer" algorithm | 
| Eternal ID of this version: | #1022938/5 | 
| Text MD5: | 5b704628c20c8a0c279d4d78d1f5fd55 | 
| Author: | stefan | 
| Category: | javax / a.i. | 
| Type: | JavaX fragment (include) | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2019-05-05 19:44:35 | 
| Source code size: | 387 bytes / 8 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 478 / 520 | 
| Version history: | 4 change(s) | 
| Referenced in: | [show references] |