Genetic algorithm tests. May 1999 This is a standard ga app, trying to find a string of values that satisfy a certain condition. look at the fitness checker in the source for exactly what we're looking for here. The crossover / child generation is a little different than normal. I was away from my notes & books when i wrote this, so i just did it from memory, and screwed it up, but it still seems to work fine... for all i know this may be faster than the standard method. (which involves finding out all of the children before going on to the next generation) What i do is i have a sliding generation. i constantly grab two good candidates (parents) and breed a child, which i put in the worst position. this is the flow: 1) pick two good candidates (or one good, one very good) 2) pick the worst candidate ( array[worst] ) 3) breed the candidates from (1) and place the result in (2) 4) re-sort the population 5) repeat as you can see, there's no real "generation" at any particular time. everyone just kinda gets old together. I determine it's finished when one of the following criteria are met: A) the entire string fulfils the fitness check, with no penalties B) the fitness is above some arbitrary value C) the first element in the population has the same fitness as the last element. (C) will prevent looping if the population ever fills up with all of the same element, which i was having a problem with. -jsl@absynth.com 26 August 1999