Great demo of an evolutionary algorithm.

For detailed description, see Walker_project.pdf.

Basically, a genetic algorithm is used to evolve "runners".

You can show the results by using the "display.bat"
function. use a dos command window.

e.g.,

display leaner.txt
display bird.txt

shows some initial creatures. the goal is to
evolve creatures that run to the right as fast as
the can! note that the creature can jump up a biy
(it has springs under its its feet) and adjust
the angle between its legs.

initially, bird just jumps up and falls down.
leaner.txt shows that leaning to the right does
help a bit. (until you hit the ground.)

now ceck out:

display hopper.txt  -f 200         
display windmill5111.txt -f 200

(the -f flag lets the display go a bit faster.)

the creatures are discovering a few better ways
of moving to the right.


now check out:

display sprinter7661.txt -f 200

this guy has learned how to move!! in fact, the ga
trains up to a distance of about 5000. the little sprinter
has discovered that it can go faster and faster by
leaning over more and more! it crashes, right on the
finish line!

runners-code.doc shows the lisp like function that
was evolved to get the runner to move.

note that programming a competitive creature
by hand may not be that easy!

enjoy!


Evolutionary Walker
===================
Allen Wang  (aww6@cornell.edu)
Matt Harren (mth13@cornell.edu)


Contents of this CD:
--------------------
src/        -- Java source files for this project
classes/    -- Compiled class files
GA.bat      -- DOS batch file to run the genetic algorithm
display.bat -- DOS batch file to run the the visualization program
compile.bat -- DOS batch file to recompile the program
Walker_project.doc -- project documentation in Word format
Walker_project.pdf -- same document in PDF format
README.txt  -- this readme file
*.txt       -- various walker programs we have found.
               sprinter7661, hopper, and windmill5111 are the best of these


Running GA:
-----------
The GA class runs the genetic algorithm to find walker programs. 
Each time a new "best" walker is found it is saved as "walkerXXXX.txt", where XXX is the fitness.
The overall best walker is saved as best.txt.

command-line format:
GA pop_size max_gen mutation_prob cross_prob selection_method [filename_for_seed]

arguments:
   pop_size:          Population size for the genetic algorithm.
   max_gen:           Number of generations to run the algorithm.
   mutation_prob:     Mutation probability.
   cross_prob:        Crossover probability.
   Selection_method:  Use 0 for Roulette-wheel selection, 1 for weak
                         tournament selection.
   filename_for_seed: [optional] The filename of the program with which
                         to seed the starting population.


Running the display:
--------------------
The PhysicalSim class runs a walker program and animates the outputs using Java Swing.

command-line format:
display [-f <frame_rate>] [filename] [-bruce]

arguments:
   frame_rate:  frames per second for the animation.  Defaults to 10 if 
                   no frame rate is specified on the command line.
   filename:    File containing the program to be displayed.  Defaults to 
                   "best.txt" if no file is specified on the command line.



