All Projects → catseye → ALPACA

catseye / ALPACA

Licence: other
A Language for the Pithy Articulation of Cellular Automata

Programming Languages

python
139335 projects - #7 most used programming language
perl
6916 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ALPACA

cas
Cellular Automata Simulator
Stars: ✭ 22 (+4.76%)
Mutual labels:  cellular-automata
rlifesrc
A Game of Life pattern searcher written in Rust. 用 Rust 搜索生命游戏中的图样。
Stars: ✭ 15 (-28.57%)
Mutual labels:  cellular-automata
logic-life-search
Cellular automata search program
Stars: ✭ 23 (+9.52%)
Mutual labels:  cellular-automata
netomaton
A Python library for working with Network Automata, Cellular Automata, and other discrete dynamical systems
Stars: ✭ 38 (+80.95%)
Mutual labels:  cellular-automata
cabasa
A generic 2D cellular automaton simulator
Stars: ✭ 21 (+0%)
Mutual labels:  cellular-automata
ws-ldn-10
Generative design workshop (Clojure/ClojureScript)
Stars: ✭ 26 (+23.81%)
Mutual labels:  cellular-automata
forma
A Lua toolkit for computational geometry on a grid
Stars: ✭ 34 (+61.9%)
Mutual labels:  cellular-automata
Roguelike-Procedual-Cave-Generator
A procedurally generated, cave-like dungeon/map creator for rogue-like games using the cellular automata method. During its development, I solved a common/limiting problem with this algorithm that might explain why it is not more commonly implemented in such games.
Stars: ✭ 26 (+23.81%)
Mutual labels:  cellular-automata
evoplex
Evoplex is a fast, robust and extensible platform for developing agent-based models and multi-agent systems on networks. It's available for Windows, Linux and macOS.
Stars: ✭ 98 (+366.67%)
Mutual labels:  cellular-automata
python-algorithms-and-simulations
Different algorithms and simulations from gravity simulations to cellular automata, implemented in python.
Stars: ✭ 21 (+0%)
Mutual labels:  cellular-automata
Growing-Neural-Cellular-Automata-Pytorch
Extended experiments of "Growing Neural Cellular Automata" https://distill.pub/2020/growing-ca/
Stars: ✭ 47 (+123.81%)
Mutual labels:  cellular-automata
alchemy
Generate any a-by-( b + c ) finite rectangle SVG containing potentially Infinitely many a-by-( 2 * b ) finite rectangles animated along a number line of ( ( c - b ) / a )^n scale symmetry.
Stars: ✭ 29 (+38.1%)
Mutual labels:  cellular-automata
Generative-Art-Sketches
A Generative Art Gallery with the idea of creating a virtual Art Gallery with my creations. I have tried my hands on creating some visually appealing art using Cellular Automata, Recursive Grammar, Phyllotaxis, Sandpiles, Perlin Noise, IFS, Tiling.
Stars: ✭ 24 (+14.29%)
Mutual labels:  cellular-automata
terrame
TerraME is a programming environment for spatial dynamical modelling
Stars: ✭ 33 (+57.14%)
Mutual labels:  cellular-automata
The Powder Toy
Written in C++ and using SDL, The Powder Toy is a desktop version of the classic 'falling sand' physics sandbox, it simulates air pressure and velocity as well as heat.
Stars: ✭ 3,128 (+14795.24%)
Mutual labels:  cellular-automata
PyGameofLife
Conway's Game of Life using python's matplotlib and numpy
Stars: ✭ 40 (+90.48%)
Mutual labels:  cellular-automata
conwayste
Multiplayer Conway's Game of Life (desktop app + server) implemented in Rust
Stars: ✭ 22 (+4.76%)
Mutual labels:  cellular-automata
Truth
A Domain Representation Language
Stars: ✭ 23 (+9.52%)
Mutual labels:  meta-language
Mixed Cell Cellullar Automata
The Mixed-Cell Cellullar Automata (MCCA) provides a new approach to enable more dynamic mixed landuse modeling to move away from the analysis of static patterns. One of the biggest advantages of mixed-cell CA models is the capability of simulating the quantitative and continuous changes of multiple landuse components inside cells.
Stars: ✭ 33 (+57.14%)
Mutual labels:  cellular-automata
Algorithms
Free hands-on course with the implementation (in Python) and description of several computational, mathematical and statistical algorithms.
Stars: ✭ 117 (+457.14%)
Mutual labels:  cellular-automata

ALPACA

This is the reference distribution for the ALPACA cellular-automaton definition language.

ALPACA is an acronym for a language for the pithy articulation of cellular automata. It is capable of succinctly expressing the rules of a 1- or 2-dimensional cellular automaton with an arbitrary neighbourhood.

As an example, here is John Conway's Game of Life automaton, expressed in ALPACA (it's short):

state Dead  " "
  to Alive when 3 Alive and 5 Dead;
state Alive "*"
  to Dead when 4 Alive or 7 Dead.

See the file ALPACA.markdown in the doc directory for a complete specification of the ALPACA language, version 1.1. It is written in Falderal literate test suite format; the examples given in the spec are test cases, which can be run against an implementation. The test.sh script does this.

This distribution also contains the reference implementation of ALPACA version 1.1, written in Python (runs under both Python 2.7 and Python 3.x). Its source is in the src directory and bin/alpaca is a script to start it from the command line (no installation is required; just put this bin directory on your executable search path.) See below for more information on the reference implementation.

This distribution also contains a compiler for an older version (0.94) of ALPACA, which is written in Perl and which compiles ALPACA descriptions to Perl. It can be found in the impl/alpaca.pl directory. It is no longer maintained.

History

While RUBE was being developed it became clear to the author that the "bully" approach to writing a complex cellular automaton would result in a program extremely difficult to understand and even worse to maintain.

ALPACA was developed in order to have a terse, precise and readable language in which to express the rules for any given cellular automaton. It is in ALPACA, then, that REDGREEN, a successor to RUBE, is written. Being described in ALPACA instead of C, the source code for REDGREEN is easily a hundred times clearer than the knotted mess that is RUBE.

Other cellular automata that have been successfully described in ALPACA include John Conway's famous Game of Life automaton, the lesser-known WireWorld automaton, and all of Chris Pressey's later cellular automaton designs.

The first version, 0.80, of the ALPACA compiler was written as an attributed grammar in CoCo/R from which a C source file was generated.

This was rewritten in version 0.90 to a hand-coded compiler in Perl 5 that produces a Perl program that accepts an automaton form (a start state) as input, in the form of an ASCII text file, and animates it in the terminal based on the rules of the defined cellular automaton.

Versions 0.93 and 0.94 succeeded version 0.90, but did not include any significant changes to the language, only to the reference implementation. Versions 0.91 and 0.92 possibly existed at some point as well, but if so, they are now lost.

(Note that these version numbers are highly inaccurate. Version 0.94 was not the ninety-fourth iteration of development.)

Originally, the name ALPACA was an acronym for a language for programming arbitrary cellular automata. However, as it was recognized by the author that the cellular automata expressible in ALPACA were far from arbitrary (limited to two dimensions and the Moore neighbourhood), a new backronym was sought.

Version 1.0 of ALPACA introduced a relatively formal specification, including many examples which serve as test cases, as well as an entirely new reference implementation, rewritten from scratch in Python. It also added several new features to the language, such as user-defined neighbourhoods and allowing a pre-defined CA configuration to be included with the CA description. (This last enhancement makes ALPACA CA-complete, which is almost the same as Turing-complete except that there is no way to define, in ALPACA, what it means for a cellular automaton to halt.)

The currrent version of the ALPACA language is 1.1, which clarifies a few points of the specification, adds a few (non-normative) features to the reference implementation, and introduces ALPACA Stylesheets 1.0, a system for specifying an appearance for cellular automata.

Reference Implementation

The reference implementation, bin/alpaca, can evolve a cellular automaton, given its rules as described in ALPACA along with an initial configuration (which may be supplied as part of the ALPACA description itself.) It can also compile the ALPACA description to a program in Javascript that will evolve the cellular automaton.

Testing

The new implementation of ALPACA in Python has been tested with:

The specification, written in Falderal format, contains examples which are run as tests. The reference implementation also contains internal tests.

Future Work

  • Generalize the compiler subsystem. It should really compile to an intermediate representation (IR) that looks like the AST of a generic procedural language. Then there should be an optimization pass which eliminates obviously unnecessary code in the IR. The final pass should compile the IR to Javascript, Perl, or whatever else.
  • Generally clean up and document the code more.
  • Animate the given cellular automaton in the terminal, using curses.
  • Implement non-trivial fixpoint detection: if playfield matches any of the last n playfields, then halt.
  • Implement some option to halt under other, even more complex circumstances, such as some portion of the playfield matching some pattern.
  • Add the ability to display certain values (generation number, coordinates of top-left corner, etc.) in divider string, by making it a formatting string.

Contributors

Future Work

Possible ways in which the language could be extended in the future:

  • Allow the halting predicate to be defined in the ALPACA description itself somehow. This would make ALPACA Turing-complete.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].