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

Re: [netlogo-users] Problems with the "file-read" primitive in Netlogo 2.0.1

Expand Messages
  • gregortroll@vinofemmemusica.com
    Hi all! My e-mail hasn t got lilibeth s original message yet, but thorston s reply did arrive. We did a lot of work with GIS files at last weeks NetLogo
    Message 1 of 3 , Aug 1, 2004
    • 0 Attachment
      Hi all!

      My e-mail hasn't got lilibeth's original message yet, but thorston's reply did
      arrive.

      We did a lot of work with GIS files at last weeks NetLogo workshop at the
      Advanced Learning Center of Mesa State College (which was a blast, more on all
      that later).

      One of the big things we learned (and it took way too long to realize it), is
      that there is a catastrophic bug in the file-read primitive of netlogo 2.0.1
      that does not exist in 2.0.0.

      We learned that while reading a largish text file (say a file that represents a
      150 x 150 grid, organized into a single column of 3 digit integers), the file
      would restart at the beginning over and over.

      Here's a sample of the kind of code we used:

      to read-map [ filename rows cols ]
      locals [ temp-row temp-map ]
      file-open filename
      set temp-map [] ; a global
      repeat rows
      [ set temp-row []
      repeat cols
      [ set temp-row lput file-read temp-row ]
      set temp-map lput temp-row temp-map
      ]
      file-close
      report temp-map
      end

      This was paired with a procedure to display the data in the patches, that I
      won't detail here.

      Suffice it to say, that the code runs perfectly in netlogo 2.0.0, and does not
      on 2.0.1.

      By using a test file that simply contained 150 x 150 numbers in sequence, then
      coloring the result to show discontinuities, and especially to show when the
      sequence started over at zero, we saw that the file read was set back to the
      beginning from time to time, but may also have caught up with itself.

      I was planning on testing the extent of the bug more, but seeing this, I decided
      to just get the info out there.

      Again, more on the GIS system later.

      Hope this helps,

      ~~James.
    • Seth Tisue
      ... James One of the big things we learned (and it took way too long to James realize it), is that there is a catastrophic bug in the James file-read
      Message 2 of 3 , Aug 2, 2004
      • 0 Attachment
        >>>>> "James" == gregortroll <gregortroll@...> writes:

        James> One of the big things we learned (and it took way too long to
        James> realize it), is that there is a catastrophic bug in the
        James> file-read primitive of netlogo 2.0.1 that does not exist in
        James> 2.0.0.

        James> I was planning on testing the extent of the bug more, but seeing
        James> this, I decided to just get the info out there.

        We know about this (see
        e.g. http://groups.yahoo.com/group/netlogo-users/message/1916) and we'll
        be fixing it for NetLogo 2.0.2, which we plan to release this week.

        ==
        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.