I'm creating a virtual society where turtles have a 3 dimensional vector of opinions.What I'd like is that each turtle in the network has a vector of opinions that is related to turtles in the network following a normal distribution.
A possibility I reckon would be to create turtles with random opinions and then at the end of the setup process bring these opinions close together . So for instance, turtle 0 has opinions [0.2 0.8 0.6]
, turtle 1 has [0.7 0.5 0.5]
and turtle 2 has [0.9 0.4 0.1]
. The mean being [0.6 0.6 0.1]
, then each turtle's vector of opinions would be reestablished following a normal distribution [0.6±0.1 0.6±0.1 0.6±0.1]
Below what I am trying, which doesn't work because my (map mean ([opinions] of my-nearby-turtles)
bit gives the mean of all dimensions of opinions for each turtle instead of the mean of each dimension of opinions for all turtles...
ask turtles [
set opinions n-values 3 [random-float 1]
(foreach opinions (map mean ([opinions] of turtles)) [ [a b] -> set a random-normal b 0.1])
]
end