The cl-ca Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-ca Reference Manual

This is the cl-ca Reference Manual, version 0.0.1, generated automatically by Declt version 2.3 "Robert April" on Tue Jan 09 13:27:24 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

cl-ca: common lisp cellular automata

cl-ca is a common lisp library for implementing programs using cellular automata (e. g. Conway's game of life).

usage

There some example programs to introduce you.

Most functions also include a docstring.

architecture

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:

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.

can I ql:quickload it?

Yes


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-ca

Author

Lukas Epple <post@lukasepple.de>

License

Public Domain

Description

cellular automaton library

Version

0.0.1

Source

cl-ca.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-ca.asd

Location

cl-ca.asd

Systems

cl-ca (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-ca/packages.lisp

Parent

cl-ca (system)

Location

packages.lisp

Packages

cl-ca


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-ca/cl-ca.lisp

Dependency

packages.lisp (file)

Parent

cl-ca (system)

Location

cl-ca.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cl-ca

cellular automaton library

Source

packages.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: create-automata GEN-STATE FUN

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

Package

cl-ca

Source

cl-ca.lisp (file)

Function: get-automaton POS

gets an automaton from the hash table (in the closure)

Package

cl-ca

Source

cl-ca.lisp (file)

Function: get-dimensions ()
Package

cl-ca

Source

cl-ca.lisp (file)

Function: moore-neighbors POS DIM

calculates the moore neighbors of an automaton

Package

cl-ca

Source

cl-ca.lisp (file)

Function: print-automata CONVERSION-FUN

prints the automata between two positions. It uses a conversion function to determine which char to use

Package

cl-ca

Source

cl-ca.lisp (file)

Function: run-step NEIGHBORHOOD

runs the the simulation for one step. it invokes the automata in the 2d grid defined by set-dimensions

Package

cl-ca

Source

cl-ca.lisp (file)

Function: set-automaton POS STATE FUN

sets an automaton in the hash table (in the closure)

Package

cl-ca

Source

cl-ca.lisp (file)

Function: set-dimensions DIM

Sets the dimensions (bondaries) of the simulation (cons upperleft lowerright)

Package

cl-ca

Source

cl-ca.lisp (file)

Function: von-neumann-neighbors POS DIM

calculates the von Neumann neighbors of an automaton

Package

cl-ca

Source

cl-ca.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Functions

Function: wrap-if-necessary POS DIM

Makes sure that pos is always between the boundaries of (car dim) and (cdr dim). Wraps pos if necessary

Package

cl-ca

Source

cl-ca.lisp (file)

Function: wrap-one-dim N MIN MAX

makes sure that a position is always in the boundary min - max and wraps it around if necessary

Package

cl-ca

Source

cl-ca.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-ca.asd: The cl-ca<dot>asd file
cl-ca/cl-ca.lisp: The cl-ca/cl-ca<dot>lisp file
cl-ca/packages.lisp: The cl-ca/packages<dot>lisp file

F
File, Lisp, cl-ca.asd: The cl-ca<dot>asd file
File, Lisp, cl-ca/cl-ca.lisp: The cl-ca/cl-ca<dot>lisp file
File, Lisp, cl-ca/packages.lisp: The cl-ca/packages<dot>lisp file

L
Lisp File, cl-ca.asd: The cl-ca<dot>asd file
Lisp File, cl-ca/cl-ca.lisp: The cl-ca/cl-ca<dot>lisp file
Lisp File, cl-ca/packages.lisp: The cl-ca/packages<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   F   G   M   P   R   S   V   W  
Index Entry  Section

C
create-automata: Exported functions

F
Function, create-automata: Exported functions
Function, get-automaton: Exported functions
Function, get-dimensions: Exported functions
Function, moore-neighbors: Exported functions
Function, print-automata: Exported functions
Function, run-step: Exported functions
Function, set-automaton: Exported functions
Function, set-dimensions: Exported functions
Function, von-neumann-neighbors: Exported functions
Function, wrap-if-necessary: Internal functions
Function, wrap-one-dim: Internal functions

G
get-automaton: Exported functions
get-dimensions: Exported functions

M
moore-neighbors: Exported functions

P
print-automata: Exported functions

R
run-step: Exported functions

S
set-automaton: Exported functions
set-dimensions: Exported functions

V
von-neumann-neighbors: Exported functions

W
wrap-if-necessary: Internal functions
wrap-one-dim: Internal functions

Jump to:   C   F   G   M   P   R   S   V   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-ca: The cl-ca system
cl-ca: The cl-ca package

P
Package, cl-ca: The cl-ca package

S
System, cl-ca: The cl-ca system

Jump to:   C   P   S