Devon McCormick schreef:
> I see.
>
> In that case, based on only a cursory examination, I might suggest you break
> out the evolution step like this:
>
> evo1=: 3 : 0
>    p=. 1+?#y
>    tc=. ord (p-1){y
>    vk=. (?3){chr (32+?95), (tc+1), tc-1
>    kind=. vk (p-1)}y
>    kinds=. pw ffit kind
>    kind;<kinds
> )
>
> then alter your loop to test a batch of mutations at once:
> ...
> while. 0<s do.
>    'kind kinds'=. evo1 &> 10$<oud
>    wh=. kinds i. </kinds,s
>    's oud'=. wh{&>(kinds,s);<kind,oud
>    g=.g+1
> NB. ('gen: ',(":g),'(',(":s),') ',oud) (1!:2) 2
> end.
> ...
>
>   
I see, but you will have to count
the right amount of generation steps.
Working with a population will give another GA, e.g.
mutation and sexual pairing the fittest.
> The other thing I might do would be to eliminate the conversions between
> character and numeric inside the
> loop - it looks more natural to work completely with integers, perhaps
> converting once at the top of the
> function and converting back at the bottom.
>
>   
You're right, after rereading 'evolueer' I decided that too.

BTW is there anything on this subject in J?


Thanks

=@@i



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to