Here is a crazy hack I did to handle this kind of problem. Note that what I really wanted to do was to make a list of the numerical values resulting from applying a function to every agent in an agentset, but no. I have to get them to all apply the function about me, then I have to call the function one time extra to find out what the result was that got passed to me. I also had to rewrite the function so that I can have either the agent I'm interested in as the argument (if I'm running it) or me in the argument (if an agent is running it about me). Sheesh!
to-report min-edge-distance [agentset maxsize]
report ifelse-value (any? agentset)
[edge-distance min-one-of agentset [edge-distance myself true] false] ; grr, what I want is min map edge-distance agentset, instead I have to do backflips
[maxsize]
end
to-report edge-distance [alex me?]
report ifelse-value (me?) ;because of netlogo's perverse syntax, I've been forced to ask someone else to figure out my edge distance – alex may be me!
[(distance alex) * (sqrt [energy] of alex / (sqrt [energy] of alex + sqrt energy) )] ;alex is me!
[(distance alex) * (sqrt energy / (sqrt [energy] of alex + sqrt energy) )] ; alex is not me
end