Courses/CS 461/Winter 2007/Smbat Bagdassarian/Week 5

From CSWiki

Jump to: navigation, search

The uploaded project is basically a small C# application. What it does is it randomly generates 6 integers and compares it with our given unlock code. To simplify things, imagine we have a standard lock used on gym lockers or high school lockers. We all know that each lock comes with it's own unlock code. Well, this program does the same thing. It randomly generates unlock codes and tries matching it up with the correct unlock code.

If you run the application, you will see 6 integers on the left followed by its fitness function directly on the right hand side. As the generations increase, it is obvious to note that the fitness function becomes 1 (or 100%) more often; in some cases, even all the time.

This is because of the "natural selection" process of the algorithm.

Attached is an EXE of the application along with it's source code:

http://cs.calstatela.edu/wiki/images/f/fd/GeneticAlgorithm.zip

Personal tools