lecture EC GP implementation 5 Jan 2000 This lecture will illustrate how to implement GP. It will show the general structure of a GP program. The specific detail of the problem to be solved will be avoid. The code will be explained in a top-down fashion. First, let's look at some assumption. The terminal set is dependent on the problem. Let the function set be {if-and, if-or, if-not} with arity 4,4,3. These functions have their usual semantic. The individual is indexed by pgm[i]. Let the population size be POP. The selection is elitism, selecting the NBEST to be parents. Now let's look at the main loop : run the experiment for G generations. PRIVATE runexperiment( int G) { gen = 0; while( gen++ < G ) { for( i=0; i 'n' ) return NIL; c -= 'a'; if ( isterm(c) ) return c; ap = getacell(); cmd(ap) = c; arg1(ap) = fromfile(fp); arg2(ap) = fromfile(fp); arg3(ap) = fromfile(fp); if( is4arg(cmd(ap)) ) arg4(ap) = fromfile(fp); return ap; } Here is the example of the output (formatted to fit page) : nfbngngmmjgbflllldijnbiniedjilcnlfgajljfbgddijnggkanmg ljagkddaknihdghgef Some question, is this traversal a 'depth-first' or 'breadth-first'?