Loading ...
Sorry, an error occurred while loading the content.

Re: [netlogo-users] Distance primitive

Expand Messages
  • James Steiner
    Since you don t say how the turtles are selected, I m going to assume the existence of a patch variable gang that contains the agentset of turtles in
    Message 1 of 2 , Oct 31, 2011
    • 0 Attachment

      Since you don't say how the turtles are selected, I'm going to assume the existence of a patch variable "gang" that contains the agentset of turtles in question.

      And since you don't say why the patches are checking the distance, I'm going to check distance to find a turtle closest to the mean distance of all these gang of turtles.

      Ask patches
      [ set gang turtles with [criteria ]
        Let mean-gang mean [distance myself ] of gang
        Let middle-most min-one-of gang [ abs ( mean-gang - distance myself ) ]
        Do-something-with middle-most
      ]

      I hope this suggests to you the kind of things that are possible, and gives you an idea of what to look for in the NetLogo primitives dictionary.

      ~~James
      Turtlezero.com

    Your message has been successfully submitted and would be delivered to recipients shortly.