Background
I used this answer to select a turtle based on a probability distribution determined by the turtle's popularity or fitness.
Issue
I am trying to pass a parameter that determines which of the turtle's property the probability distribution is determined by.
Question
How can I perform an equivalent of a "python unpacking" of a parameter in netlogo?
Sample code
turtles-own
[
fitness
strength
degree ;;Node's Connectness
popularity
wealth
]
to-report pick-turtle-biased-by-property [turtle-list property-to-unpack]
let prob-list []
let turtle-list []
ask turtles [
set prob-list lput [[property-to-unpack] of self ] prob-list
set turtle-list lput self turtle-list
]
report first rnd:weighted-one-of-list (map list turtle_list prob-list) last
end