Hi!
In my quest to construct a program to derive the question to the answer of Life, the Universe and Everything (which is, as any schoolchild knows, 42), I wrote a very simple genetic algorithm solver.
I don't mean simple as in "simple to use", I mean absolute braindead simple. By some definitions, this is not really a genetic algorithm because the "genome" is the same as the data being operated on (there is no "expression"), but it's a cute toy and somebody else might find it entertaining as well:
https://bitbucket.org/oofoe/ga/src/9523 ... at=default
I am currently hard at work on a new program which will use a genetic algorithm to do lossy image compression through vector shapes, just have to teach NewLisp about reading %.png files...
ANNOUNCE: A Simple Genetic Algorithm in NewLisp...
ANNOUNCE: A Simple Genetic Algorithm in NewLisp...
Testing can show the presence of bugs, but not their absence.
Re: ANNOUNCE: A Simple Genetic Algorithm in NewLisp...
Incidentally, here's how to determine if a file is a png image using the standard libpng library:
Sorry, Windows only at this point. UNIX users please substitute library names as appropriate.
Code: Select all
;; C library functions.
(import "msvcrt.dll" "fopen")
(import "msvcrt.dll" "fread")
;; PNG library functions.
(import "libpng16-16.dll" "png_sig_cmp")
(define (pngfile? path)
"( path -- f) Determines if path is a %.png file."
(letn ((header "XXXXXXXX")
(fp (fopen path "rb")))
(fread header 1 (length header) fp)
(zero? (png_sig_cmp header 0 (length header)))))
Testing can show the presence of bugs, but not their absence.
Re: ANNOUNCE: A Simple Genetic Algorithm in NewLisp...
Genetic algorithms are great. You also might be interested in fuzzy logic. Similarly to genetic algorithms, fuzzy logic can solve mathematically complex problems in a simple way. This book uses newLISP for all examples:
A Practical Introduction to Fuzzy Logic using LISP
By Luis Argüelles Méndez (arguelles on this forum)
http://www.springer.com/us/book/9783319231853
A Practical Introduction to Fuzzy Logic using LISP
By Luis Argüelles Méndez (arguelles on this forum)
http://www.springer.com/us/book/9783319231853