GraphCellFitness
Home ] Up ] Initcel() ] SelectParents ] CalcAllFitness ] [ GraphCellFitness ] PrintCell ] Declarations ]

 


In the graph_cell_fitness routine a window is thrown on the screen which lets you see the overall fitness of the cell.  This is calculated quite simply by adding up the fitness of each chromosome.  As they get more fit the whole cell value is more fit.  This is just a straightforward way to see your chromosomes "growing" toward some value.

Here is an example of what you'll see:

wpe3.jpg (18649 bytes)

In this case, the graph nicely moves upward, but often the graph will "flatten out."  This means you have reached a local optima.  This is the value of having multiple runs in for a problem, for many times you can avoid falling into the same local optima. You may set the runs in the declaration section of the program.  The width of the window remains constant now matter how many generations you prescribe for each run. Think of the window as automatically scaling the graph to your input.  (This is noted in the source code.)

If your chromosomes find a perfect match in terms of fitness, GALIB will report this:

wpe5.jpg (15880 bytes)

The (2,1) in the above message indicates where in the cell the chromosome is found.  This cell had 12 chromosomes in it, and a perfect fit was found on the 4th run after 17 generations of births/deaths.  The total number of births was 1332, but this was because of the multiple runs.  The variables here are tied to this equation: x * y + z = 28.  Here then 2 multiplied by 11 equals 22, then add 6 and you get 28.  Finally, the chromosome in question is shown. In the above picture, I have marked off the genome with red lines.  The first gene is six bits, 000010, which is the x value (and thus 2).  The second gene is nine bits, 000001011, which is the y value (and thus 11).  The third is also nine bits, 000000110, which is the z value (and thus 6). 

Clicking the OK allows the runs to continue, clicking Cancel will halt the program.