There are three optimization methods implemented:
Powell (po) - opt-policy1.c
Nelder Mead (nm) - opt-policy1-nm.c
Simulated Annealing (sa) - opt-policy1-sa.c

With the current initial gait and optimization parameters,
Powell's method reduces the cost from 42 to about 3.
Nelder Mead does about the same.
Simulated Annealing does not do as well (42 -> 25).

Some questions (which I would address in order).
1) Given the current initial gait parameters, how well can you get
these methods to work?
2) Can you make simulated annealing work as well as the other methods?
3) Can you get the GNU scientific library routines to do as well or better?
http://www.gnu.org/software/gsl
Try the GNU simulated annealing and Nelder-Mead routines.
4) Varying the initial gait parameters, can you find even better solutions?


The optimizations are controlled by parameters embedded in the programs:
Powell (po) - opt-policy1.c: look at xi[i][j]
Nelder Mead (nm) - opt-policy1-nm.c: look at p_offsets[i]
Simulated Annealing (sa) - opt-policy1-sa.c: look at p_offsets[], 
         temperature, iter1, iter2, n_temperatures, decay

Parameters files specify gait parameters.
Examples of parameter files: pl-po, pl-nm, pl-sa (currently all the same).
Here is some explanation:
desired_speed     0.300000000000 end   This should not be changed.
how_many_trials    9.900000000000 end  An evaluation actually uses 10 walks
                                       with different random noise to see
                                       how good a set of gait parameters is.
trial_duration    10.00000000000 end   How long a walk is.
rand_scale     0.100000000000 end      How big is the random noise
                                       Gait parameters that are optimized.
swing_time     0.416180342436 opt end
swing_hip1    -0.504371643066 opt end 
...
                                       Other controller parameters
pitch_d     0.000000000000 end
knee_ff_peak    -0.000000000000 end
...
                                       Launch parameters
l2_movement_duration     0.351599514484 end
l2_rhip     0.250000357628 end
...


To run an optimization
./opt-policy1i pl-po
which produces pl-po.new

To simulate walking.
./walki pl-po
In addition to displaying the simulation too fast to see,
this produces a data file like d02010

To display a data file as a movie
./display
to show the most recent data file or 
./display d02010
to show a particular data file.
