December 09, 2004
Charlemagne

cheval noir

Charlemagne is a genetic programming tool that is written in both Python and Lisp [via gavin]. The uneasy truce between the two languages seems to have come about when clisp was embedded in Python.

From the manual:

Here is an example of an interactive session defining a complex deviance calculating function:

>>> lsp.interactive()
CLISP> (defvar SPEED 0.05)
SPEED
CLISP> (defvar TURNS 50.0)
TURNS
CLISP> (defun simulator-helper (p turns x y)
  ...>     (if (eq turns 0)
  ...>         (sqrt (+ (* x x) (* y y)))
  ...>         (progn
  ...>             (setq INPUT1 x)
  ...>             (setq INPUT2 y)
  ...>             (let ((theta (degrees-to-radians (eval p))))
  ...>                 (simulator-helper
  ...>                     p
  ...>                     (- turns 1)
  ...>                     (+ x (* SPEED (cos theta)))
  ...>                     (+ y (* SPEED (sin theta))))))))
'SYRUP-DEVIANCE-HELPER'
CLISP> (defun simulator (p)
  ...>        (/ (deviance-helper TURNS 50 INPUT1 INPUT2) TURNS))
'SYRUP-DEVIANCE'
CLISP> exit
>>> cfg.configure("deviance-calculation", LISP-FUNCTION=simulator)
>>> cfg.configure("input", [[1.0,1.0], [0.5,0.5], [-1.0,-1.0], 
    [-0.5,-0.5], [0.25,-0.25],[-1.0,0.75], [0.25,-0.5], [1.0,-1.0]])
>>> cfg.apply()
Posted by jjwiseman at December 09, 2004 02:49 PM
Comments

Happy 1000th post (kinda, excluding some porting and renumbering issues).

Posted by: Aaron Brady on December 9, 2004 03:26 PM

Wurghfl...

That is one of the most disturbing things I have ever seen, definite visceral horror factor.


Posted by: Barf on December 9, 2004 03:52 PM

Heh, thanks! I noticed that when I initially posted it, and meant to go back and update it with a mention, but then I got distracted.

Woo!

Posted by: John Wiseman on December 9, 2004 04:02 PM
Post a comment
Name:


Email Address:


URL:




Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)

Comments:


Remember info?