Download Jar. Libraryless. Click here for Pure Java version (7190L/51K).
!7 p-exp { new AIStrategy_RandomWithVariation<S> strat; strat.best.replaceIfSameScore = true; LS plusExamples = ll("eval this", "eval that"); LS minusExamples = ll("do this", "do that", "avoid that", "let's do stuff", "don't be evil"); strat.submit = f1_scoreRegexpIC(plusExamples, minusExamples); strat.random = func -> S { randomID(1) }; // random letter between a and z strat.vary = func(S s) -> S { appendInRandomOrder(s, randomID(1)) }; runStrategyForever/*WhileImprovement*/(strat, optimumScore := 100.0); }
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1024190 |
Snippet name: | Grow random regexps Spike [dev.] |
Eternal ID of this version: | #1024190/11 |
Text MD5: | 47a861bce1f3efc9e1c2be90cab3b675 |
Transpilation MD5: | deb5b4b6662f2580dd7ee8693a638697 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-24 23:12:16 |
Source code size: | 541 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 226 / 822 |
Version history: | 10 change(s) |
Referenced in: | [show references] |