Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -5,7 +5,7 @@ enum C = 100; // Number of children in each generation.
|
|||
enum P = 0.05; // Mutation probability.
|
||||
enum fitness = (dchar[] s) => target.zip(s).count!q{ a[0] != a[1] };
|
||||
dchar rnd() { return (uppercase ~ " ")[uniform(0, $)]; }
|
||||
enum mut= (dchar[] s) => s.map!(a=> uniform(0,1.) < P ? rnd : a).array;
|
||||
enum mut = (dchar[] s) => s.map!(a => uniform01 < P ? rnd : a).array;
|
||||
|
||||
void main() {
|
||||
auto parent = target.length.iota.map!(_ => rnd).array;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue