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

Re: [netlogo-users] Inradius-nowrap with [...] inconsistencies / problems

Expand Messages
  • Seth Tisue
    ... Michael Hi all, while working at my current model (a game), I Michael noticed two kinds of strange behavior from the NetLogo Michael
    Message 1 of 2 , Apr 30, 2004
    • 0 Attachment
      >>>>> "Michael" == Michael Kuyumcu <m.kuyumcu@...> writes:

      Michael> Hi all, while working at my current "model" (a game), I
      Michael> noticed two kinds of strange behavior from the NetLogo
      Michael> interpreter/compiler:
      Michael> 1) You can ask a TURTLE to adress all other turtles of a
      Michael> certain shape in a specified radius from the calling turtle to
      Michael> do something with the command ask turtle x [ask turtles
      Michael> in-radius-nowrap 10 with [shape = "bomb"] [...do
      Michael> something...]]
      Michael> But you cannot have a PATCH calling the very same turtles, as
      Michael> ask patch x y [ask turtles in-radius-nowrap 10 with [shape =
      Michael> "bomb"]]

      That shouldn't be the case. It should work either way. In my testing,
      it does work either way. I'm unable to reproduce the bug using the code
      shown above. Has anyone else ever seen this? Michael, perhaps you
      could send a model that demonstrates the bug to
      bugs@...?

      Michael> 2) You can set the shape of a turtle to a custom-defined form
      Michael> with set shape "Bomb".
      Michael> But if you try to find turtles with that shape later, you
      Michael> may not capitalize the first letter of the form name. So if
      Michael> you check later with if shape = "Bomb", you will not find a
      Michael> single turtle. But if shape = "bomb" works. Another nasty
      Michael> bug.

      This is working as designed -- although maybe it's a bad design. The
      equality operator is case sensitive. But "set shape" isn't case
      sensitive and will silently correct the case you use to the "correct"
      case.

      Perhaps getting the capitalization wrong when you use "set shape" should
      be a runtime error, instead of the present behavior. I think when we
      initially designed this that we were afraid that was too unfriendly.
      But I agree that what you experienced is unfriendly as well. Hmm...

      ==
      Seth Tisue / seth@... / (847) 467-2814
      lead developer, NetLogo http://ccl.northwestern.edu/netlogo/
      Center for Connected Learning and Computer-Based Modeling
      School of Education and Social Policy / Department of Computer Science
      Northwestern University
    Your message has been successfully submitted and would be delivered to recipients shortly.