Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testable #1

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
17cba4b
Changed egol_cell to spawn a process to collect from its neighbours
lehoff Nov 20, 2014
0511574
Add initial content for cell and run_until feature.
lehoff Nov 30, 2014
66ed85f
Removed dead code.
lehoff Nov 30, 2014
07a23ec
Add ability to kill cells by coordinates.
lehoff Dec 1, 2014
e9a7f0f
Add egol:mode/0 and egol:max_time/0.
lehoff Dec 1, 2014
10edcdc
Add supervisor and manager process.
lehoff Dec 1, 2014
1d33955
Added extra test.
lehoff Dec 1, 2014
68b3d9d
Removed dead function is_pacer_running.
lehoff Dec 7, 2014
d3d3813
Add test for NDC London 2014 talk example.
lehoff Dec 7, 2014
cb3918a
Add readme to explain what the repo is about.
lehoff Dec 7, 2014
4ffb292
egol_cell changed to gen_server
lehoff Dec 8, 2014
4cca3cc
egol is now a gen_server.
lehoff Dec 8, 2014
be319d2
Test: starting a cell works
lehoff Dec 9, 2014
3203fe3
NOT WORKING. Weird issue with eqc and step cmd in egol_cell.
lehoff Dec 9, 2014
e0b0e8d
Remove set from collector process.
lehoff Dec 9, 2014
dd555a0
Add egol_proctol module. One step works in test.
lehoff Dec 9, 2014
d1d0c13
Remove started field for egol_eqc starte.
lehoff Dec 9, 2014
fd47d05
Created target for adding vm.args to the release.
lehoff Dec 11, 2014
17e67dc
Created array based solution to GOL.
lehoff Dec 11, 2014
7b3d1e7
Add flood_query_response command.
lehoff Dec 11, 2014
233475e
minor tweaks to egol_util
lehoff Dec 11, 2014
56b8c73
config dir added
lehoff Dec 11, 2014
22ff647
Removed gproc.
lehoff Dec 11, 2014
ed74741
Fully removed gproc.
lehoff Dec 12, 2014
ef03224
Clean-up cell_mgr
lehoff Dec 12, 2014
0bdbc84
make release is smarter
lehoff Dec 12, 2014
d9862c7
Minor clean-ups in egol and egol_cell_mgr
lehoff Dec 12, 2014
d2432d1
egol_time
lehoff Dec 12, 2014
973088b
Removed gproc from egol_eqc
lehoff Dec 12, 2014
41ccfe6
Removed all dead code for gproc
lehoff Dec 12, 2014
109ef30
Add egol_cell:collector/1 for testing purposes.
lehoff Dec 14, 2014
71b439b
Add complete_step to ease modelling of restarting cells.
lehoff Dec 14, 2014
2f7487b
Made egol_cell_mgr carry mode.
lehoff Dec 14, 2014
6b2b326
Refactored query_response args.
lehoff Dec 14, 2014
7664477
Fix variable to atom for run mode.
lehoff Dec 14, 2014
acc7be0
egol_eqc: carry neighbour history in model
lehoff Dec 14, 2014
04ae03d
Added egol_sup to start everything.
lehoff Dec 15, 2014
e0e2755
Got the start-up for egol_eqc working.
lehoff Dec 15, 2014
35c321e
kill without future works
lehoff Dec 15, 2014
3747c74
Remove flood_query_response and complete_step
lehoff Dec 15, 2014
f253f4e
Changed to only one kill per test case
lehoff Dec 15, 2014
af07000
egol_eqc speed_up and some tweaks to egol_cell
lehoff Dec 15, 2014
0622a49
egol_eqc:query_content added
lehoff Dec 15, 2014
ebedfc1
corrected replay of neighbour_history
lehoff Dec 18, 2014
5cfe3ed
Removed cell and collector pids usage
lehoff Jan 28, 2015
ccbe04f
Changed to use collecting_status for egol_cell
lehoff Jan 28, 2015
5785090
Changed the restart interval to allow testing
lehoff Jan 29, 2015
23e5dd2
Exported types and nicer kill function
lehoff Jan 29, 2015
7f19916
Hacks to forget old tests. NEEDS CLEAN UP
lehoff Jan 29, 2015
3a43f94
Ask restarted neighbour about content again.
lehoff Feb 2, 2015
5bd9c32
WIP kill_neighbour stash
lehoff Feb 2, 2015
ecc451e
Everything but kill is working
lehoff Feb 4, 2015
74f774f
egol_cell:stop/0 added and monitor loop for neighbours
lehoff Feb 4, 2015
a54bcfb
use spawn_link on pacer process
lehoff Feb 4, 2015
828000f
Remove stop function from egol_sup
lehoff Feb 4, 2015
eebf304
Start egol application - almost working
lehoff Feb 4, 2015
46e0c8d
Correct variable name for egol_cell_mgr in egol_sup
lehoff Feb 4, 2015
55cfd20
Trying one_for_one supervisor for cells
lehoff Feb 4, 2015
3ba9c82
Proper app file.
lehoff Feb 9, 2015
b7549f6
Remove manual start of egol_sup
lehoff Feb 9, 2015
a24ca64
Test works fine. Ready to do clean-up.
lehoff Feb 9, 2015
758e078
Clean-up: commented out io:format
lehoff Feb 9, 2015
bc32ae9
Clean-up eqc. removed all printouts and dead code
lehoff Feb 9, 2015
a007bc2
Clean-up - spurious last_query_response bug
lehoff Feb 9, 2015
2bc0928
Fix incorrect named last_query_response_pre fun
lehoff Feb 9, 2015
ac8f9c3
Fix start when clause to be conjunction
lehoff Feb 9, 2015
afa8954
Added apps to allow percept2 to run.
lehoff Feb 17, 2015
ccc2da2
Minor clean-up.
lehoff Feb 17, 2015
e8518e2
await_new_neighbour checked in
lehoff Apr 10, 2015
4404895
Add egol_app to git
lehoff Apr 10, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ deps
*.plt
erl_crash.dump
ebin
rel/example_project
_rel/*
.concrete/DEV_MODE
.rebar
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
PROJECT = egol

DEPS = edown gen_leader gproc lager
#DEPS = edown gen_leader gproc lager
DEPS = lager

dep_gproc = git git://github.com/uwiger/gproc 0.3.1
dep_edown = git https://github.com/esl/edown.git master
dep_gen_leader = git https://github.com/abecciu/gen_leader_revival.git master
#dep_gproc = git git://github.com/uwiger/gproc 0.3.1
#dep_edown = git https://github.com/esl/edown.git master
#dep_gen_leader = git https://github.com/abecciu/gen_leader_revival.git master

include erlang.mk

Expand All @@ -15,5 +16,7 @@ ERLC_COMPILE_OPTS= +'{parse_transform, lager_transform}'
ERLC_OPTS= $(ERLC_COMPILE_OPTS) +debug_info
TEST_ERLC_OPTS= $(ERLC_COMPILE_OPTS)

release: app
relx --vm_args "./config/vm.args"


26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
This repo originates from this article (link to NDC article) and the associated talk
at NDC London 2014 (link to slideshare).

Conway's Game of Life cell automaton is used to show how to think like an Erlanger.

The principle of using asynchronous message passing and thinking in terms of
protocols describing the interactions between processes is applicable to a number of
settings, not just Erlang, but the overlay of using Erlang supervision is much easier
and straightforward to do in Erlang.

The contents of the repo has moved on from the initial version used for the article
and the talk at NDC - even the talk code was improved from the article's - but I have
tried to tag relevant revisions to make it easier for you to cherry pick a particular
stage in the evolution of the code.

The wiki for this repo contains a more in-depth explanation of the thinking process
and the tools used than what you will find here with the code.

Notable tags:
* ndc1 - tag for the NDC article's code.

Notable branches:
* permanent_collector - instead of spawning a new collector for each time step, the
collector process is re-used. It saves so little resources (5%) that it is not
worth the hassle to do it.

8 changes: 8 additions & 0 deletions config/sys.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{lager, [
{handlers, [
{lager_console_backend, info},
{lager_file_backend, [{file, "log/error.log"}, {level, error}]},
{lager_file_backend, [{file, "log/console.log"}, {level, info}]}
]}
]}
].
1 change: 1 addition & 0 deletions config/vm.args
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
+P 10000000
8 changes: 8 additions & 0 deletions eqc_test/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@



console: beams
erl -pa ../ebin ../deps/*/ebin . -config test.config

beams:
erlc *.erl
Loading