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