[Haskell-cafe] Re: Doubly-linked zipper list w/ insert implementation

Justin Bailey jgbailey at gmail.com
Sat Nov 10 15:49:10 EST 2007


On Nov 10, 2007 12:24 PM, apfelmus <apfelmus at quantentunnel.de> wrote:
> Note that depending on your concrete setting, you may not need a fancy
> ring structure for cellular automata. And with simple automata like

I realized that I never updated my automata once a row was created,
and ended up using an unboxed array with an index to represent the
ring. I just do some math when I want to "rotate" left or right and
the index falls off the edge.

The rules are much more complex though. I am using a genetic algorithm
technique to "evolve" 7 bit rules which can classify if an initial row
was mostly black or mostly white. This is loosely related to a class
assignment.

I'm finding that taking 100 initial rules, determining their fitness
on 100 initial automatas, and doing that for 100 generations is taking
a loooong time. Our teacher's implementation, in C, does it in about a
minute. Mine takes hours :( . I think its becuase the C algorithm does
a lot of bit-twiddling to iterate the automata, while I'm using lists
of integers (1, 0).

Anyways, thanks for your thoughts!

Justin


More information about the Haskell-Cafe mailing list