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

Re: [netlogo-users] Re: How real a tool is NetLogo?

Expand Messages
  • R. G. 'Stumpy' Marsh
    ... I m aware of that, but if turtles move once each time through go , but the list of vacant patches is accessed several times each time through go , then
    Message 1 of 22 , Mar 1 2:12 AM
    • 0 Attachment
      On Mon, 27 Feb 2006 09:20:06 -0600, you wrote:

      >>>>>> "R" == R G 'Stumpy' Marsh <rmarsh@...> writes:
      >
      > >> It would clearly
      > >> be better to maintain a list of vacant patches, and to update it
      > >> when a turtle relocates.
      >
      > R> set vacant-patches patches with [not any? turtles-here]
      >
      > R> Refer to vacant-patches instead of rebuilding the agentset each
      > R> time.
      >
      >Agentsets don't work that way. vacant-patches won't change as turtles
      >move; it'll still be the same set of patches it was when it was created,
      >even if some of those patches aren't vacant anymore.

      I'm aware of that, but if turtles move once each time through "go",
      but the list of vacant patches is accessed several times each time
      through "go", then it is better to set the agent-set once per cycle,
      rather than recalculate it for every use.

      This suggestion was in response to the situation where turtles were
      ask-ing patches with [not any? turtles-here] "every time", which
      suggested to me repeated use of the set, possibly either wholly before
      or wholly after any turtle movement. That would make a global
      variable a more efficient way of coding the set. Certainly it
      wouldn't be the appropriate response for every situation.
      --
      R.G. "Stumpy" Marsh.
      Timaru, New Zealand.
    Your message has been successfully submitted and would be delivered to recipients shortly.