Application of Genetic Algorithms to Task Planning and Learning