X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=life%2F001%2FREADME.md;fp=life%2F001%2FREADME.md;h=85e55228df3c26d8f768e6698cf36aa318272bda;hb=8d06c463b83b79e046250fbe60e5429f182e3a7a;hp=0000000000000000000000000000000000000000;hpb=4eb3be32ce405e69f39573b5e38171764cd0d789;p=cellular-automata.git diff --git a/life/001/README.md b/life/001/README.md new file mode 100644 index 0000000..85e5522 --- /dev/null +++ b/life/001/README.md @@ -0,0 +1,37 @@ +life-001 +======== + + +Approach +-------- +The grid is represented as flat list of sequential ID's, where neighbors are +calculated using the offset relative to the desired length of the printed +X-axis. See my prototyping doodles at the bottom. + +Each cell is represented as a gen_server process named after its corresponding +ID on the grid and holding the names of its neighbors in its state record. + +Likewise, time is represented as a gen_server process which sends ticks to all +cells and collects state responses, then proceeds to sort and print the +resulting board - this constitutes one generation. + +Upon receipt of a tick, a cell broadcasts its state to its neighbors, then +proceeds to collect counterpart broadcasts from its neighbors. Upon collection +of all broadcasts - it calculates its new state and sends it to the time +process. + +Additionally, there's, a non-essential, observer process, whose job is to +simply log the statistics for each run of the simulation. + + +Usage +----- +* Get: `git clone git://github.com/ibnfirnas/life.git` +* Enter: `cd life/001` +* Build: `make` +* Run: `./bin/life` + + +Doodles +------- +![Doodles](https://github.com/ibnfirnas/life/raw/master/001/doodles.jpg) \ No newline at end of file