Skip to content

Commit

Permalink
Shuffle migration destinations before zip with agent groups
Browse files Browse the repository at this point in the history
  • Loading branch information
bzurkowski committed Apr 4, 2017
1 parent c59a2ec commit a3a71e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mas_migration.erl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ send_back(Source, Agents) -> send_to_population({Source, Agents}).
%%------------------------------------------------------------------------------
group(Destinations, Agents) ->
AgentGroups = mas_utils:partition(Agents, length(Destinations)),
lists:zip(Destinations, AgentGroups).
lists:zip(mas_utils:shuffle(Destinations), AgentGroups).

%%------------------------------------------------------------------------------
%% @private
Expand Down

0 comments on commit a3a71e9

Please sign in to comment.