In nature, a spider would use natural selection to decide which set of features are advantageous. We are going to do something similar here by using a "fitness function" (or cost function is some literature). The fitness function could be continuous and be something as simple as "Take two times the size, add that to one times the height, divide the sum by the energy and raise it to the exponent of the number of legs:

((2*S + L)/E)^N

You can see the results for each spider. Note that the cost function could be an algorithm of it's own, like a function of code that returns a value for how "fit" the chromosome is. However, if the cost function is discontinous, the "hill climbing" part later might not work and could lead to a sub-optimal result.

Return to my homepage