Printing X and Y in the status bar.
[cellular-automata.git] / 001 / src / life_god.erl
index d9f6237..8000eaa 100644 (file)
@@ -3,7 +3,7 @@
 
 
 %% API
--export([start_link/2]).
+-export([start_link/3]).
 
 %% Callbacks
 -export([init/1]).
 %% API
 %% ============================================================================
 
-start_link(X, CellData) ->
-    supervisor:start_link({local, ?MODULE}, ?MODULE, [X, CellData]).
+start_link(X, Y, CellData) ->
+    supervisor:start_link({local, ?MODULE}, ?MODULE, [X, Y, CellData]).
 
 
 %% ============================================================================
 %% Callbacks
 %% ============================================================================
 
-init([X, CellData]) ->
+init([X, Y, CellData]) ->
     CellNames = [Name || {_, Name, _} <- CellData],
-    RestartStrategy = {one_for_one, 5, 10},
+    RestartStrategy = {one_for_one, 1000000, 1},
     Cells = [spec_cell(Datum) || Datum <- CellData],
-    Time = ?CHILD(worker, life_time, [X, CellNames]),
+    Time = ?CHILD(worker, life_time, [X, Y, CellNames]),
     Children = Cells ++ [Time],
     {ok, {RestartStrategy, Children}}.
 
@@ -39,9 +39,3 @@ spec_cell({_, Name, _}=Datum) ->
     F = start_link,
     A = [Datum],
     {Name, {M, F, A}, permanent, 5000, worker, [M]}.
-
-    %{ID, {ID, start_link, Args}, permanent, 5000, Type, [ID]}.
-
-
-
-
This page took 0.031514 seconds and 4 git commands to generate.