DIFFERENT BITS
The circuit in action.
Example of Steven Rooke’s genetically
evolved fractals.
time to create our own! The
interactive evolution example we will
implement is a variation on the
program discussed in Part 2 of this
series, “Hello World.” Last time, we
used a PIC to employ a Genetic
Algorithm evolving the
phrase “hello_world” on
an LCD screen. This time,
we will use four LCD
screens and pushbuttons
to evolve imaginary words,
creating a sort of pared
down version of Karl Sims’
pioneering work.
As you will remember
from last time, we
implemented the Genetic
Algorithm by using an
array to hold the old
population and an array to
hold the new population,
and we updated them in
a loop. We created a
breeding function that
contained crossover and
mutation routines, and an
evaluation function that
compared the current
population to our criteria
of success. The most
successful member of the
population would have
their currently evolved
phrase displayed on the
LCD, and when one of
them successfully evolved
the letters of “hello_world,” the
program stopped.
The code this time is very similar
and reuses a good number of the
routines from last time. There are,
however, some essential differences to
take note of. First, and most obvious,
there is no pre-defined goal. You are
the decider and the course of evolution
is entirely in your hands! Second,
stemming from this, the population is
smaller because you will be evaluating
each member of the population by
hand at each generation. A smaller
population is preferable so that you
don’t have an overwhelming number
Schematic for the circuit.
SERVO 09.2008 69