When you have a solution that matches your parameters for a successful solution. In #4, PGS said
The fact that there is a pre-determined stop executing point is not a function of the evolutionary nature of a GA; it is simply a recognition that theres not need to continue looking for answers after you have one...As I understand it, that means you know what an answer will look like, but you don't know what the answer is. I'm sure he can explain better.And the fact there is a stop executing point does not mean your answer is pre-ordained. Ive run GAs on the same problem set, with the same initial seeding, and come up with different - but still very viable and useful - results.
Yes, and in a programmed genetic algorithm, that "solution" is used in each iteration to tailor the results of the iteration.
THE COMPUTER PROGRAM IN APPENDIX E IN "UPON THE SHOULDERS OF GIANTS" BY RICHARD HARDISON 10 REM 1984 R. HARDISON 11 PRINT "RANDOMIZING ALPHABET" 12 PRINT "WRITE HAMLET, KEEPING" 13 PRINT "SUCCESSES." 14 PRINT :; REM N-COUNTER: # OF TRIALS 15 REM T=COUNTER:REUSE "TO BE" 16 PRINT "SUBROUTINE TO 17 PRINT "RANDOMIZE AND SELECT" 18 PRINT "LETTER" 30 N = 0 40 FOR G = 1 TO 10 50 T = 0 60 GOTO 80 70 X = INT (26 * RND (1)) + 1: RETURN 80 GOSUB 70 90 N = N + 1 100 IF X = 20 THEN PRINT "T": IF X = 20 THEN GOTO 120 110 GOTO 60 120 N = N + 1 130 GOSUB 70 140 IF X = 15 THEN PRINT "O": IF X = 15 THEN PRINT : IF X = 15 THEN GOTO 160 150 GOTO 120 160 N = N + 1 170 GOSUB 70 180 IF X = 2 THEN PRINT "B": IF X = 2 THEN GOTO 200 190 GOTO 160 200 N = N + 1 210 GOSUB 70 220 IF X = 5 THEN PRINT "E": IF X = 5 THEN PRINT : IF X = 5 THEN GOTO 240 230 GOTO 200 240 T = T + 1 250 IF T = 2 THEN GOTO 460 260 N = N + 1 270 GOSUB 70 280 IF X = 15 THEN PRINT "O": IF X = 15 THEN GOTO 300 290 GOTO 260 300 N = N + 1 310 GOSUB 70 320 IF X = 18 THEN PRINT "R": IF X = 18 THEN GOTO 340 330 GOTO 300 340 N = N + 1 350 GOSUB 70 360 IF X = 14 THEN PRINT "N": IF X = 14 THEN GOTO 380 370 GOTO 340 380 N = N + 1 390 GOSUB 70 400 IF X = 15 THEN PRINT "O": IF X = 15 THEN GOTO 420 410 GOTO 380 420 N = N + 1 430 GOSUB 70 440 IF X = 20 THEN PRINT "T": IF X = 20 THEN PRINT : IF X = 20 THEN GOTO 60 450 GOTO 420 460 PRINT "N=";N;" KEYS PRESSED TO WRITE 'TO BE OR NOT TO BE'" 470 PRINT "FOR";G;" RUN(S) OF PROGRAM" 480 PRINT 490 NEXT G 500 END 510 REM IF THE PROGRAM WERE 511 REM WRITTEN TO INCLUDE 512 REM PUNCTUATION MARKS ETC. 513 REM THE PROGRAM WOULD 514 REM TAKE LONGER, BUT WOULD 515 REM STILL NOT BE PROHIBI- 516 REM TIVE 517 PRINT 518 PRINT "WITH 3000 RUNS, THE MEAN" 519 PRINT "# of trials=333" 520 PRINT "THE MEAN TIME REQUIRED" 521 PRINT "WAS .14 MINUTES TO PRINT" 522 PRINT "TOBEORNOTTOBE" ------------------------------- From this analysis of Darwin, Hamlet, Dawkins, Hardison, coincidence, and selective evolution, we may conclude that whether the reality of evolution is to be believed or not to be believed, methinks it is like a weasel of truth nonetheless. Michael Shermer
I modified it to fix the run on lines, but it still has syntax problems which I don't need to fix to show how silly the program is. Essentially the program waits around until it gets the correct letter then moves on to the next until the whole "phrase" "TOBEORNOTTOBE" is generated. The spaces are put in by the program. Whatta marroooonnn! -- Bugs Bunny. Then, as if it means anything, the average number of iterations over 3000 runs is given, viz. 333. Well, that algorithm waits on average 18 iterations to get a .5 probability of not getting the letter. And 18*13 is 234. Plus, if I threw away the "invalid" letters not matching each position and only considered the remaining letters(no replacement), at most only 26*13 iterations would be required. That is 338.