From: Ken A. <kan...@bb...> - 2004-03-30 15:41:08
|
Here's a contest to build the tinniest genetic programming system: http://cswww.essex.ac.uk/staff/sml/gecco/TinyGP.html There is a C++ version that is about 1600 lines of code http://www.gel.ulaval.ca/~beagle/puppy/index.html Since Koza's original code was in Common Lisp, I'd expect a Lisp implementation to be about as tiny as you can get. It looks like you can get his implementation down to under 1,000 lines of code. I'm wondering if JScheme (or Arc) can do any better. The code needed to read the input data is surprisingly small: (load "elf/basic.scm") (load "elf/sort.scm") (define (read-data file) ;; Returns (listOf FitnessCase) where a FitnessCase is a list of ;; X1 ... Xn TARGET. (let* ((data (call-with-input-file file (lambda (s) (map* identity s))))) (by (+ (car data) 1) (cddr data)))) I'm not sure if i could submit something myself, so anybody want to participate with me? k |