Genetic Programming: Theory, Implementation, and the Evolution of Unconstrained Solutions
Total Page:16
File Type:pdf, Size:1020Kb
Genetic Programming: Theory, Implementation, and the Evolution of Unconstrained Solutions Alan Robinson Division III Thesis Committee: Lee Spector Hampshire College Jaime Davila May 2001 Mark Feinstein Contents Part I: Background 1 INTRODUCTION................................................................................................7 1.1 BACKGROUND – AUTOMATIC PROGRAMMING...................................................7 1.2 THIS PROJECT..................................................................................................8 1.3 SUMMARY OF CHAPTERS .................................................................................8 2 GENETIC PROGRAMMING REVIEW..........................................................11 2.1 WHAT IS GENETIC PROGRAMMING: A BRIEF OVERVIEW ...................................11 2.2 CONTEMPORARY GENETIC PROGRAMMING: IN DEPTH .....................................13 2.3 PREREQUISITE: A LANGUAGE AMENABLE TO (SEMI) RANDOM MODIFICATION ..13 2.4 STEPS SPECIFIC TO EACH PROBLEM.................................................................14 2.4.1 Create fitness function ..........................................................................14 2.4.2 Choose run parameters.........................................................................16 2.4.3 Select function / terminals.....................................................................17 2.5 THE GENETIC PROGRAMMING ALGORITHM IN ACTION .....................................18 2.5.1 Generate random population ................................................................18 2.5.2 Measure fitness of population ...............................................................18 2.5.3 Select the better individuals from the population...................................18 2.5.4 Apply genetic operators until a new population is generated.................19 2.5.5 Repeat until a program solves the problem or time runs out..................19 2.5.6 Example run .........................................................................................20 2.6 OTHER TYPES OF GP......................................................................................20 2.6.1 Lisp with Automatically Defined Functions (ADFs) ..............................21 2.6.2 Linear genetic programming.................................................................21 2.6.3 Machine code genetic programming .....................................................22 2.6.4 Stack-based genetic programming ........................................................22 2.7 THE NO FREE LUNCH THEOREM ......................................................................22 2.8 REVIEW OF PREVIOUS AND CONTEMPORARY GP RESULTS...............................23 2.8.1 Data classification................................................................................23 2.8.2 Software agents.....................................................................................24 2.8.3 Simulated and real robotics controllers.................................................25 2 Part II: PushGP 3 THE PUSH LANGUAGE & PUSHGP .............................................................28 3.1 OVERVIEW OF PUSH/PUSHGP - THEORETICAL MOTIVATIONS ..........................28 3.2 PUSH AS A TOOL OF UNCONSTRAINED SOLUTION DISCOVERY ..........................28 3.3 THE PUSH LANGUAGE....................................................................................30 3.3.1 Some simple Push programs .................................................................30 3.3.2 Push stacks in detail .............................................................................31 3.3.3 Selective consideration of parenthesizes................................................31 3.3.4 A more advanced example: factorial.....................................................32 3.3.5 Points & subtrees..................................................................................32 3.3.6 The Push instruction set........................................................................33 3.4 THE BASE PUSHGP SYSTEM ...........................................................................35 4 PUSHGP COMPARED TO GP2 WITH ADFS................................................37 4.1 CAN A MORE FLEXIBLE SYSTEM PERFORM AS WELL?.......................................37 4.2 THE COMPUTATIONAL EFFORT METRIC ...........................................................38 4.2.1 Mathematical definition of computational effort ...................................38 4.3 MEASURING MODULARITY.............................................................................39 6 4 2 4.4 SOLVING SYMBOLIC REGRESSION OF X –2X + X ..........................................40 4.4.1 Koza’s results with and without ADFs...................................................40 4.4.2 Using PushGP with a minimal instruction set .......................................40 4.4.3 PushGP with a full instruction set.........................................................43 4.5 EVEN PARITY AS A GP BENCHMARK ..............................................................44 4.5.1 Koza’s work on even-four-parity...........................................................45 4.6 SOLVING EVEN-FOUR-PARITY USING PUSHGP AND STACK INPUT ....................45 4.6.1 Full PushGP instruction set ..................................................................45 4.6.2 Minimal function set with list manipulation ..........................................50 4.6.3 Minimal function set with rich list manipulation ...................................51 4.7 EVEN-FOUR-PARITY WITH INPUT FUNCTIONS ..................................................53 4.7.1 Minimal PushGP instruction set and max program length 50................53 4.7.2 With minimal instruction set and max program length 100....................54 4.7.3 Minimal PushGP instruction set and max program length 200..............54 4.7.4 Minimal PushGP instruction set and max program length 300..............55 4.7.5 Conclusions of PushGP research with terminals ...................................56 4.8 EVEN-SIX-PARITY..........................................................................................57 4.8.1 Solving even-six-parity with full PushGP instruction set and stacks ......57 4.9 SOLVING EVEN-N-PARITY..............................................................................60 4.9.1 Fitness cases.........................................................................................61 4.9.2 Measuring generalization .....................................................................61 4.9.3 Trial 1: maximum program length = 50 and 100 ..................................61 4.9.4 Future directions ..................................................................................63 4.10 CONCLUSIONS DRAWN FROM THIS CHAPTER...................................................64 3 5 VARIATIONS IN GENETIC OPERATORS ...................................................65 5.1 PERFORMANCE OF BASE PUSHGP OPERATORS................................................65 5.2 VARIATIONS IN CROSSOVER...........................................................................66 5.2.1 Smaller-overwrites-larger crossover .....................................................66 5.2.2 Smaller-overwrites-larger-on-overflow crossover..................................66 5.2.3 Smaller-tree-overwrites-larger-tree-on-overflow crossover ...................66 5.2.4 Subtree-biased, smaller-overwrites-on-overflow crossover....................67 5.3 VARIATIONS IN MUTATION.............................................................................67 5.3.1 Bounded mutation.................................................................................67 5.3.2 Node mutation ......................................................................................67 5.4 EMPIRICAL TESTS WITH NEW OPERATORS .......................................................68 5.5 CONCLUSIONS DRAWN FROM THESE RUNS......................................................71 6 NEW GROUND – EVOLVING FACTORIAL.................................................73 6.1 CAN IT BE DONE?...........................................................................................73 6.2 FACTORIAL TRIAL 1 .......................................................................................73 6.3 TRIAL 2.........................................................................................................75 6.4 TRIAL 3.........................................................................................................76 6.5 FUTURE RESEARCH .......................................................................................77 Part III: LJGP 7 LINEAR CODED GENETIC PROGRAMMING IN JAVA............................80 7.1 FEATURE OVERVIEW......................................................................................80 7.2 PRACTICAL MOTIVATION FOR USING JAVA .....................................................81 7.3 OVERVIEW OF DESIGN DECISIONS...................................................................81 7.3.1 Linear machine code vs. trees ...............................................................82 7.3.2 Steady-state tournament selection .........................................................83 7.4 DISTRIBUTED PROCESSING.............................................................................83 8 LJGP USER’S GUIDE.......................................................................................85 8.1 ENCODING A PROBLEM ..................................................................................85