Getting a property for each turtle

This should be trivial and quite common! But apparently not. I have defined “effort” thus:

and now I want each turtle to do some stuff within the radius of its own “effort”

“yum” is defined previously as

I get the following error:

There is no agent for MYSELF to refer to.

error while turtle 5 running MYSELF

called by procedure MOVE-TURTLES

called by procedure GO

called by Button ‘go’

Suggestions?

This is one of the more confusing parts of NetLogo. You don’t need to use myself here you can just do

myself is used to refer to the asker agent when agents ask other agents to do things. For example if you had two types of turtles called sheep and goats

That would have each sheep ask one goat to set its xcor to the effort value of the sheep that asked it to do that.

That is the FIRST thing I tried, and got the error (in the statement:set dxx [pxcor] of yum - xcor):

OF expected input to be a turtle agentset or patch agentset or turtle or patch but got the number 0 instead.
error while turtle 6 running OF
called by procedure MOVE-TURTLES
called by procedure GO
called by Button ‘go’

Thanks. I changed some other things, and it seems to work now. I wll soon post it to the common repository of models.

That error implies that yum was a variable with the value of 0 rather than a patch or turtle.

I had to initialize it: set yum self in setup-patches.

Can you please tell me why my turtles jump more than is possible with the variable effort (currently set effort random-float 3 in setup-turtles)?
Currently I have:

Rather than debugging this, I’ll give you a way easier way to do this in a NetLogo-y way:

That should do what you want (move to the patch with the largest resource within the radius effort including if that patch is the one the turtle is currently on).