Biology Inspired Computing Work
By selecting attractive parents, more attractive children are born. So, if you cross bread better solutions to a given problem, you can find a better solution.
Using this, i decided to demonstrate this principal visually using c#.net.
If you was a spider, and you was looking for anice place to live, where would you live? In this example, you have toassume the bird represents a birds nest. You would want to live as faraway from this as possible. You also have to assume that your source offood is in the grass. You would want to be as close to this aspossible.
The aim of this program is to calculate the best solution to the given problem.
1st Generation
The answer to this problem is still unknown.We generate 100 random solutions and then assess how fit are thesolutions. Fitness is measured by calculating the distance from thegrass (On the grass is ideal) then subtracting the distance from thebird.
Generation 2, Getting closer
The fitness results have been sorted intoorder. The 50 most unfit solutions have been deleted. From the 50remaining solutions, 100 new potential solutions were generated. Thenew solutions take some of the information from the parents (ie – theircoordinates are related by an equasion).
Generation 3
Calculating fitness, removing some unfitsolutions and generating new solutions close to the existing ones isrepeated (again and again).
Generation 3
And again and again and again.
5 Cycles
1 in 1000 solutions is generated completely atrandom. This is mutation. The rate of mutation can be changed [too muchand you never settle at a solution, too little and you risk missing thesolution all together]. If This prevents the search from getting stuckin a local best situation. [Example, imagine you are in the centre of arange of mountains, every direction you look is up hill so you believeyou are at the lowest ground level when this isnt the case - if you hada friend who parachuted out a helicopter at a random coordinates, hemay be able to see that behind the mountain there is a big hole in thefloor]
10 Cycles
After 20 cycles, they have almost settled at the best location
After 20 cycles, they have almost settled at the best location
Download Source












No comments yet... Be the first to leave a reply!