Just imagine you are going to program a robot with tens of motors for its motion. How can you write a program to harmonize all these motors to make this robot move forward? Is a nightmare, right? Luckily, genetic algorithm can wake you up with hope from this bad dream, because it can leave the burden to computers to find optimal solution.
Genetic algorithm basically applies the evolution idea in nature. By evolutionism, the individuals carry the poor genes that causes them cannot survival will be filtrated; only the individuals, who are strong and adapted to environment, have the chance to passes down their genes to next generation. Similarly, genetic algorithm works as following, taking robot motion controlling as an example:
1. Create the commands to control the robot randomly for the first generation. A group of command is called individual and total number of groups in one generation is called population.
2. Get the performance of each individual and calculate its fitness by running each group of codes on either real robot or virtual robot in simulation software. Fitness is the measurement of how well an individual meets the goal of genetic algorithm. In our example, because we try to find the commands to make robot move as far as possible, the displacement between the initial position and end position is the fitness.
3. After get fitness for all individuals, genetic algorithm starts creating the offspring generation. For each individual in the offspring generation, two individual as parents will be selected from previous generation by fitness, which means that individual with bittern fitness has larger possibility to be selected. After two parents have been selected, mutation will happen by randomly switching part of the commands in these two parents. This is usually called as mutation. Then the new individual will be saved for the offspring generation. Genetic algorithm will repeat this step until the offspring generation has the same population as parent generation.
4. The genetic algorithm will keep running until reach the stop criteria. Stop criteria can be either how good the fitness is or total time that genetic algorithm has been running or both. So at the end of genetic algorithm, an individual with the best fitness will be generated.
Here we just give a simple example of application of genetic algorithm. Hitherto, much more complex genetic algorithm has been used in very wide areas. However, application of genetic algorithm has not been fully developed. With genetic algorithm, few years later, computers may become more creative than human being.
Reference
http://www.solver.com/gabasics.htm?gclid=CMbhq5jEgZICFRE0FQodmQoA-w






Leave a Comment
You must be logged in to post a comment.
* You can follow any responses to this entry through the RSS 2.0 feed.