A Genetic Algorithm with Characteristic Preservation for Function Optimization