Update example for genetic algorithm.

* fix a few problems in the farm class
* change the power functional