|
PrintCell
|
|
|
When a solution is found, all the chromosomes and all the pertinent information is printed out in the debug screen in visual basic. (It would be very easy to modify this routine to dump this information to a screen form or to a disk or to email. Whatever.) The information looks something like this: Cell()Info ( 1 , 1 ): [ .25 ]0000011000010001 ( 2 , 1 ): [ .25 ]0000011000010001 ( 1 , 2 ): [ .25 ]0000011000010011 ( 2 , 2 ): [ .25 ]0000011000010001 ( 1 , 3 ): [ .25 ]0000011000010011 ( 2 , 3 ): [ .25 ]0000011000010001 ( 1 , 4 ): [ .25 ]0000011000010001 ( 2 , 4 ): [ .25 ]0000011000010001 ( 1 , 5 ): [ .25 ]0000011000010001 ( 2 , 5 ): [ 1 ]0000011000010010 ( 1 , 6 ): [ .25 ]0000011000010011 ( 2 , 6 ): [ .25 ]0000011000010001 ( 1 , 7 ): [ .25 ]0000011000010001 ( 2 , 7 ): [ .25 ]0000011000010001 ( 1 , 8 ): [ .25 ]0000011000010001 ( 2 , 8 ): [ .25 ]0000011000010011 ( 1 , 9 ): [ .25 ]0000011000010001 ( 2 , 9 ): [ .25 ]0000011000010001 ( 1 , 10 ): [ .25 ]0000011000010001 ( 2 , 10 ): [ 1.515152E-02 ]0000111000010001 ( 1 , 11 ): [ .25 ]0000011000010001 ( 2 , 11 ): [ 1.923077E-02 ]0000011000000001 ( 1 , 12 ): [ .25 ]0000011000010001 ( 2 , 12 ): [ 4.545455E-02 ]0000011000011001 ( 1 , 13 ): [ .25 ]0000011000010001 ( 2 , 13 ): [ .25 ]0000011000010001 ( 1 , 14 ): [ .25 ]0000011000010001 ( 2 , 14 ): [ .25 ]0000011000010001 ( 1 , 15 ): [ .25 ]0000011000010001 ( 2 , 15 ): [ .25 ]0000011000010001 ( 1 , 16 ): [ .25 ]0000011000010011 ( 2 , 16 ): [ 1.845018E-03 ]0100011000010001 ( 1 , 17 ): [ .25 ]0000011000010001 ( 2 , 17 ): [ 3.703704E-03 ]0010011000010001 ( 1 , 18 ): [ .25 ]0000011000010001 ( 2 , 18 ): [ .25 ]0000011000010011 ( 1 , 19 ): [ .25 ]0000011000010001 ( 2 , 19 ): [ .25 ]0000011000010001 ( 1 , 20 ): [ 5.263158E-03 ]0000011001010001 ( 2 , 20 ): [ .25 ]0000011000010001 Cell size ( 2 x 20 ) Chromosomes: 40 Run: 1 Gen: 15 Chromosome Length: 16 Avg. Fitness: 0.2335162 Goal: 55 I suppose you really don't have to see this stuff, if you're only
interested in solving for unknown variables. But eventually, you will probably want
a solution for more complex problems. At that point you'll have to consider what is
happening in your cell. This is a big picture view of all of your chromosomes.
I've structured my cell to be 2 x 20. This makes them fit in the debug window
nicely, but you might have a 3 x 20 or anything else. Everytime the program finds a
solution it prints out the cell to the debug screen |