Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-ca Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:30:21 2022 GMT+0.
Next: Systems, Previous: The cl-ca Reference Manual, Up: The cl-ca Reference Manual [Contents][Index]
cl-ca is a common lisp library for implementing programs using cellular automata (e. g. Conway's game of life).
There some example programs to introduce you.
Most functions also include a docstring.
cl-ca is build around three functions which access the hash table all automata are stored in. This hash-table is located in a closure, therefore only these functions can access it.
The functions are:
set-automaton
used to modify/add automataget-automaton
used to get informations about an automaton
(The Hacker's note: It is just a call to gethash
)run-step
walks over a specified part of the hash-table and calculates the new states of the automatons.The data about the automata is stored this way in the hash-table:
(x . y) . (state function)
(the cons pair (x . y)
is the key and the list ist the value)
The function gets called each step with the list representing the automaton itself and a list of lists representing its neighbors (more on that later). It must return a list representing itself (this one then gets put in the hash-table). This allows an automaton not only change its state but also to modify its behavior.
The functions moore-neighbors
and von-neumann-neighbors
implement neighborhood (See the corresponding Wikipedia articles: Moore Neighborhood and Von Neumann Neighborhood). One of these functions (or another one doing something reasonable in this context) should be passed to run-step
and is used to calculate neighborhood then.
Next: Files, Previous: Introduction, Up: The cl-ca Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
cellular automaton library
Lukas Epple <post@lukasepple.de>
Public Domain
0.0.1
Next: Packages, Previous: Systems, Up: The cl-ca Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: cl-ca/cl-ca.lisp, Previous: cl-ca/cl-ca.asd, Up: Lisp [Contents][Index]
Previous: cl-ca/packages.lisp, Up: Lisp [Contents][Index]
packages.lisp (file).
cl-ca (system).
Next: Definitions, Previous: Files, Up: The cl-ca Reference Manual [Contents][Index]
Packages are listed by definition order.
cellular automaton library
common-lisp.
Next: Indexes, Previous: Packages, Up: The cl-ca Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Previous: Public Interface, Up: Public Interface [Contents][Index]
adds the automata between from-pos to to-pos in a
2d grid. For the initial state it calls gen-state each
time with the position as argument
gets an automaton from the hash table (in the closure)
calculates the moore neighbors of an automaton
prints the automata between two positions. It uses a conversion function to determine which char to use
runs the the simulation for one step. it invokes the automata in the 2d grid defined by set-dimensions
sets an automaton in the hash table (in the closure)
Sets the dimensions (bondaries) of the simulation (cons upperleft lowerright)
calculates the von Neumann neighbors of an automaton
Previous: Public Interface, Up: Definitions [Contents][Index]
Makes sure that pos is always between the boundaries of (car dim) and (cdr dim). Wraps pos if necessary
makes sure that a position is always in the boundary min - max and wraps it around if necessary
Previous: Definitions, Up: The cl-ca Reference Manual [Contents][Index]
Jump to: | C F G M P R S V W |
---|
Jump to: | C F G M P R S V W |
---|
Jump to: | C F P S |
---|
Jump to: | C F P S |
---|