{ok, X} = application:get_env(?MODULE, x),
{ok, Y} = application:get_env(?MODULE, y),
CellData = cell_data(X, Y),
- god:start_link(X, CellData).
+ life_god:start_link(X, CellData).
stop(_State) ->
--module(cell).
+-module(life_cell).
-behaviour(gen_server).
case NewPending of
0 ->
NewCellState = new_state(CellState, NewLiveNeighbors),
- ok = time:tock(ID, NewCellState),
+ ok = life_time:tock(ID, NewCellState),
{noreply, NewState#state{live_neighbors=0
,cell_state=NewCellState
--module(god).
+-module(life_god).
-behaviour(supervisor).
CellNames = [Name || {_, Name, _} <- CellData],
RestartStrategy = {one_for_one, 5, 10},
Cells = [spec_cell(Datum) || Datum <- CellData],
- Time = ?CHILD(worker, time, [X, CellNames]),
+ Time = ?CHILD(worker, life_time, [X, CellNames]),
Children = Cells ++ [Time],
{ok, {RestartStrategy, Children}}.
spec_cell({_, Name, _}=Datum) ->
- M = cell,
+ M = life_cell,
F = start_link,
A = [Datum],
{Name, {M, F, A}, permanent, 5000, worker, [M]}.