From 5fb162dd0903fbfb9d0204bffd57fcf17724b8a0 Mon Sep 17 00:00:00 2001 From: Bartosz Zurkowski Date: Sun, 26 Mar 2017 00:16:07 +0100 Subject: [PATCH] Minor refactorings --- src/mas_population.erl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mas_population.erl b/src/mas_population.erl index 1d9a2c5..9add75e 100644 --- a/src/mas_population.erl +++ b/src/mas_population.erl @@ -117,14 +117,16 @@ code_change(_OldVsn, State, _Extra) -> %% @private %%------------------------------------------------------------------------------ init_state(SP, Config = #config{population_mod = Mod}) -> + Agents = generate_population(Mod, SP, Config), Behaviours = behaviours(Mod), + BehavioursCounter = mas_counter:new(Behaviours), subscribe_metrics(Behaviours), #state{ - module = Mod, - agents = generate_population(Mod, SP, Config), - sim_params = SP, - behaviours_counter = mas_counter:new(Behaviours), - config = Config + module = Mod, + agents = Agents, + sim_params = SP, + behaviours_counter = BehavioursCounter, + config = Config }. %%------------------------------------------------------------------------------