PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/common-lisp/README.md

https://github.com/edvaladar/GAHelloWorld
Markdown | 67 lines | 50 code | 17 blank | 0 comment | 0 complexity | 75c8c69387be72918e04f1078dfebbdc MD5 | raw file
  1. # Genetic Algorithm Hello World! (Common Lisp Edition)
  2. This is a simple project intended to showcase genetic algorithms with a well
  3. known example for all new developers; namely the classic "Hello, World!"
  4. example, written in Common Lisp.
  5. ## Overview
  6. The application simply "evolves" the string "Hello, world!" from a population
  7. of random strings. It is intended to be a gentle introduction into the world
  8. of genetic algorithms, specifically using Common Lisp. The program itself is
  9. really simple, and is contained within a single file.
  10. The source is a pretty direct translation of the Python version using
  11. Common Lisp idiom, barring some parts that weren't understood. It has
  12. not been optimized for speed.
  13. You'll notice some repetition of TARGET and "Hello, World!", this is
  14. my personal preference for (and verbose combination of) default values
  15. and being explicit when calling functions. It also helps for testing
  16. on the REPL.
  17. ## Usage
  18. The project is completely self contained. To execute the application, run
  19. the following command from a shell (assuming `clisp`, `ecl` or `sbcl`
  20. is on your system path):
  21. - CCL: my old 1.4 version fails, don't know why
  22. - CLISP: `clisp -i ga-hello-world.lisp -x "(progn (main) (quit))"`
  23. - ECL: `ecl -l ga-hello-world.lisp -eval "(progn (main) (quit))"`
  24. - SBCL: `sbcl --load ga-hello-world.lisp --eval "(progn (main) (quit))"`
  25. The more 'Lispy' way would be just starting you CL implementation and
  26. issuing `(load "ga-hello-world.lisp")` and then calling the MAIN
  27. function.
  28. To run the tests you need the `lisp-unit` package. To run them from
  29. the commandline issue:
  30. - CLISP: `clisp -i ga-hello-world-tests.lisp`
  31. - ECL: `ecl -l ga-hello-world-tests.lisp`
  32. - SBCL: `sbcl --load ga-hello-world-tests.lisp`
  33. ## Copyright and License
  34. The MIT License
  35. Copyright © 2011 John Svazic, Erik Winkels
  36. Permission is hereby granted, free of charge, to any person obtaining a copy
  37. of this software and associated documentation files (the "Software"), to deal
  38. in the Software without restriction, including without limitation the rights
  39. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  40. copies of the Software, and to permit persons to whom the Software is
  41. furnished to do so, subject to the following conditions:
  42. The above copyright notice and this permission notice shall be included in
  43. all copies or substantial portions of the Software.
  44. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  45. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  46. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  47. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  48. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  49. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  50. THE SOFTWARE.