Using Julia Agents.jl, I’ve built an agent-based model where the bank agents are plotted on a x-y axis and added to the grid by “add_agents!.” This function adds the agents in a normal distribution as shown below.
I would like the distibution to look more like this:
The current code that produces a normal distribution is
Blockquote
#add Bank agents
for _ in 1:n_banks
add_agent!(Bank, model;
uninsured = rand(),
investments = 2 * rand(),
totDep = 100,
AFS_securities = rand(1:10),
social_network = rand(1:3),
vul = false,
health = true,
acolor = :black,
interest_rate = rand(1:10),
)
end
When you say a “normal” distribution, I believe what you mean is a “uniform” distribution. In fact, the distribution you want is closer to a “normal” (ie. gaussian) one.
you could do something like:
xes = rand(Normal(40,20),N)
yes = rand(Normal(75,10),N)
for (x,y) in zip(xes,yes)
add_agent!(Bank,model; uninsured = x, investments = y...)
end