Added README to life-001.
[cellular-automata.git] / 001 / README.md
CommitLineData
4aa28332
SK
1life-001
2========
3
4
5Approach
6--------
7The grid is represented as flat list of sequential ID's, where neighbors are
8calculated using the offset relative to the desired length of the printed
9X-axis. See my prototyping doodles at the bottom.
10
11Each cell is represented as a gen_server process named after its corresponding
12ID on the grid and holding the names of its neighbors in its state record.
13
14Likewise, time is represented as a gen_server process which sends ticks to all
15cells and collects state responses, then proceeds to sort and print the
16resulting board - this constitutes one generation.
17
18Upon receipt of a tick, a cell broadcasts its state to its neighbors, then
19proceeds to collect counterpart broadcasts from its neighbors. Upon collection
20of all broadcasts - it calculates its new state and sends it to the time
21process.
22
23Additionally, there's, a non-essential, observer process, whose job is to
24simply log the statistics for each run of the simulation.
25
26
27Usage
28-----
29* Build `make`
30* Run `./bin/life`
31
32
33Doodles
34-------
35![Doodles](https://github.com/ibnfirnas/life/raw/master/001/doodles.png)
This page took 0.019204 seconds and 4 git commands to generate.