anchor.diff:  -module(hybrid_island).
   -export([start/3, close/1, sendAgent/2]).
   
  +-record(counters,{fight = 0 :: non_neg_integer(),
  +                  reproduction = 0 :: non_neg_integer(),
  +                  migration = 0 :: non_neg_integer(),
  +                  death = 0 :: non_neg_integer()}).
  +
   -type agent() :: {Solution::genetic:solution(), Fitness::float(), Energy::pos_integer()}.
  +-type counters() :: #counters{}.
   
   %% ====================================================================
   %% API functions
  
positive.code:       io_util:write(dict:fetch(population,FDs),length(Agents)),
        io:format("Island ~p Fitness ~p Population ~p~n",[self(),misc_util:result(Agents),length(Agents)]),
        timer:send_after(config:writeInterval(),{write,Fitness}),
        loop(Agents,FDs);
      {agent,_Pid,A} ->
        loop([A|Agents],FDs);
      {finish,_Pid} ->
        io_util:closeFiles(FDs),
        ok
  
negative.code: %% ====================================================================
  %% Internal functions
  %% ====================================================================
  -spec loop([agent()],dict(),counters()) -> ok.
  %% @doc Glowna petla procesu. Kazda iteracja powoduje wytworzenie kolejnej generacji.
  loop(Agents,FDs,Counters) ->
    receive
      {write,Last} ->
        Fitness = case misc_util:result(Agents) of
  