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

Re: NetLogo Statistics

Expand Messages
  • kez9a
    Thanks for the information. Does the R extension allow you to run a specific number of ticks (not just once or forever)? Is there a way to do this in NetLogo?
    Message 1 of 13 , Mar 31, 2010
      Thanks for the information. Does the R extension allow you to run a specific number of ticks (not just once or forever)? Is there a way to do this in NetLogo?

      --- In netlogo-users@yahoogroups.com, rpietro <pietr007@...> wrote:
      >
      >
      > http://netlogo-r-ext.berlios.de/ - works great
      >
      >
      > kez9a wrote:
      > >
      > > Hi everyone,
      > >
      > > I am trying to analyze the behavior of an adapted team assembly model.
      > > Does NetLogo have any built-in statistics features or can we just set up
      > > whatever plots we need?
      > >
      > > Also, is there a way to set a go button to go for a certain number of
      > > ticks? So if I want to run the simulation for 200 ticks, can I do
      > > something to make that happen without having to watch the simulation run
      > > and try to stop it at just the right time?
      > >
      > > Thanks,
      > > Kevin
      > >
      > >
      > >
      >
      > --
      > View this message in context: http://old.nabble.com/NetLogo-Statistics-tp28082517p28083778.html
      > Sent from the NetLogo-Users mailing list archive at Nabble.com.
      >
    • James Steiner
      You can use REPEAT in the button code, like this: REPEAT 200 [ GO ] Of course, turn off Forever in the button, so the REPEAT is run only once. You could also
      Message 2 of 13 , Apr 1, 2010
        You can use REPEAT in the button code, like this:

        REPEAT 200 [ GO ]

        Of course, turn off "Forever" in the button, so the REPEAT is run only once.

        You could also make a procedure that does the repeating for you. While your at it, you might have it run setup, too, and then do your final bookkeeping, if there is any.

        to start-200
            setup
            repeat 200 [ go ]
            finish
        end

        ~~James

        On Thu, Apr 1, 2010 at 2:53 AM, kez9a <kez9a@...> wrote:
        Thanks for the information. Does the R extension allow you to run a specific number of ticks (not just once or forever)? Is there a way to do this in NetLogo?
      • kez9a
        James, Thanks so much. This is exactly what I needed. I figured there would be a way to do it, but couldn t find it in the documentation or previous group
        Message 3 of 13 , Apr 4, 2010
          James,
          Thanks so much. This is exactly what I needed. I figured there would be a way to do it, but couldn't find it in the documentation or previous group postings.
          Thanks again,
          Kevin

          --- In netlogo-users@yahoogroups.com, James Steiner <gregortroll@...> wrote:
          >
          > You can use REPEAT in the button code, like this:
          >
          > REPEAT 200 [ GO ]
          >
          > Of course, turn off "Forever" in the button, so the REPEAT is run only once.
          >
          > You could also make a procedure that does the repeating for you. While your
          > at it, you might have it run setup, too, and then do your final bookkeeping,
          > if there is any.
          >
          > to start-200
          > setup
          > repeat 200 [ go ]
          > finish
          > end
          >
          > ~~James
          >
          > On Thu, Apr 1, 2010 at 2:53 AM, kez9a <kez9a@...> wrote:
          >
          > > Thanks for the information. Does the R extension allow you to run a
          > > specific number of ticks (not just once or forever)? Is there a way to do
          > > this in NetLogo?
          >
        • Dan
          This R extension looks great and just the sort of thing I have been looking for to provide some more complex realtime analysis of model behaviour.
          Message 4 of 13 , Apr 5, 2010
            This R extension looks great and just the sort of thing I have been looking for to provide some more complex realtime analysis of model behaviour.

            Unfortunately, I have been unable to get it working on the Mac version of netlogo - I know there website says as such, but in my mind it can't be too different from the Linux version.

            Currently I have insatlled the R package 'rJava', placed the R folder in the netlogo extensions folder and attempted to do the equivalent of the following 2 linux instructions:

            >>Then you have to set two global environment variables by typing:
            >>export R_HOME= <path to your R installation, e.g. /usr/lib/R>
            >>export JRI_HOME= <path to the jri-folder of the rJava library, e.g. >>/usr/lib/R/library/rJava/jri or /usr/local/lib/R/site-packages/jri>

            However, when i use the code extensions[r] in netlogo I receive the following error message:
            Error in runOnce: java.lang.NullPointerException
            My reading of this is that netlogo is simply not finding the extension.

            I would really like to get this to work, does anyone have any experience using the R extension on a Mac?
            Please don't make me go back to a windows machine just to use this :(

            Any advice, as ever, is much appreciated
            Thanks for reading
            Dan



            --- In netlogo-users@yahoogroups.com, rpietro <pietr007@...> wrote:
            >
            >
            > http://netlogo-r-ext.berlios.de/ - works great
            >
            >
            > kez9a wrote:
            > >
            > > Hi everyone,
            > >
            > > I am trying to analyze the behavior of an adapted team assembly model.
            > > Does NetLogo have any built-in statistics features or can we just set up
            > > whatever plots we need?
            > >
            > > Also, is there a way to set a go button to go for a certain number of
            > > ticks? So if I want to run the simulation for 200 ticks, can I do
            > > something to make that happen without having to watch the simulation run
            > > and try to stop it at just the right time?
            > >
            > > Thanks,
            > > Kevin
            > >
            > >
            > >
            >
            > --
            > View this message in context: http://old.nabble.com/NetLogo-Statistics-tp28082517p28083778.html
            > Sent from the NetLogo-Users mailing list archive at Nabble.com.
            >
          • kez9a
            Dan, Even if you can t figure it out on a Mac, you might not be able to fall back on Windows. I followed the procedure for the R extension and have been unable
            Message 5 of 13 , Apr 6, 2010
              Dan,
              Even if you can't figure it out on a Mac, you might not be able to fall back on Windows. I followed the procedure for the R extension and have been unable to get it to work. When I try to run the sample models from the extension folder it crashes NetLogo. My project is under deadline so even if it worked it would have been a time crunch to learn how to use the R extension so I just decided not to use it.
              Kevin

              --- In netlogo-users@yahoogroups.com, "Dan" <iknowkirk@...> wrote:
              >
              > This R extension looks great and just the sort of thing I have been looking for to provide some more complex realtime analysis of model behaviour.
              >
              > Unfortunately, I have been unable to get it working on the Mac version of netlogo - I know there website says as such, but in my mind it can't be too different from the Linux version.
              >
              > Currently I have insatlled the R package 'rJava', placed the R folder in the netlogo extensions folder and attempted to do the equivalent of the following 2 linux instructions:
              >
              > >>Then you have to set two global environment variables by typing:
              > >>export R_HOME= <path to your R installation, e.g. /usr/lib/R>
              > >>export JRI_HOME= <path to the jri-folder of the rJava library, e.g. >>/usr/lib/R/library/rJava/jri or /usr/local/lib/R/site-packages/jri>
              >
              > However, when i use the code extensions[r] in netlogo I receive the following error message:
              > Error in runOnce: java.lang.NullPointerException
              > My reading of this is that netlogo is simply not finding the extension.
              >
              > I would really like to get this to work, does anyone have any experience using the R extension on a Mac?
              > Please don't make me go back to a windows machine just to use this :(
              >
              > Any advice, as ever, is much appreciated
              > Thanks for reading
              > Dan
              >
              >
              >
              > --- In netlogo-users@yahoogroups.com, rpietro <pietr007@> wrote:
              > >
              > >
              > > http://netlogo-r-ext.berlios.de/ - works great
              > >
              > >
              > > kez9a wrote:
              > > >
              > > > Hi everyone,
              > > >
              > > > I am trying to analyze the behavior of an adapted team assembly model.
              > > > Does NetLogo have any built-in statistics features or can we just set up
              > > > whatever plots we need?
              > > >
              > > > Also, is there a way to set a go button to go for a certain number of
              > > > ticks? So if I want to run the simulation for 200 ticks, can I do
              > > > something to make that happen without having to watch the simulation run
              > > > and try to stop it at just the right time?
              > > >
              > > > Thanks,
              > > > Kevin
              > > >
              > > >
              > > >
              > >
              > > --
              > > View this message in context: http://old.nabble.com/NetLogo-Statistics-tp28082517p28083778.html
              > > Sent from the NetLogo-Users mailing list archive at Nabble.com.
              > >
              >
            • vishal aggarwal
              hope u have also set the variable path to the bin folder of the R installation. my R extension works perfectly in windows. regards vishal.
              Message 6 of 13 , Apr 6, 2010
                hope u have also  set the variable 'path' to the 'bin' folder of the R installation. my R extension works perfectly in windows.

                regards
                vishal.

                On Tue, Apr 6, 2010 at 10:11 AM, Dan <iknowkirk@...> wrote:
                 

                This R extension looks great and just the sort of thing I have been looking for to provide some more complex realtime analysis of model behaviour.

                Unfortunately, I have been unable to get it working on the Mac version of netlogo - I know there website says as such, but in my mind it can't be too different from the Linux version.

                Currently I have insatlled the R package 'rJava', placed the R folder in the netlogo extensions folder and attempted to do the equivalent of the following 2 linux instructions:

                >>Then you have to set two global environment variables by typing:
                >>export R_HOME= <path to your R installation, e.g. /usr/lib/R>
                >>export JRI_HOME= <path to the jri-folder of the rJava library, e.g. >>/usr/lib/R/library/rJava/jri or /usr/local/lib/R/site-packages/jri>

                However, when i use the code extensions[r] in netlogo I receive the following error message:
                Error in runOnce: java.lang.NullPointerException
                My reading of this is that netlogo is simply not finding the extension.

                I would really like to get this to work, does anyone have any experience using the R extension on a Mac?
                Please don't make me go back to a windows machine just to use this :(

                Any advice, as ever, is much appreciated
                Thanks for reading
                Dan



                --- In netlogo-users@yahoogroups.com, rpietro <pietr007@...> wrote:
                >
                >
                > http://netlogo-r-ext.berlios.de/ - works great
                >
                >
                > kez9a wrote:
                > >
                > > Hi everyone,
                > >
                > > I am trying to analyze the behavior of an adapted team assembly model.
                > > Does NetLogo have any built-in statistics features or can we just set up
                > > whatever plots we need?
                > >
                > > Also, is there a way to set a go button to go for a certain number of
                > > ticks? So if I want to run the simulation for 200 ticks, can I do
                > > something to make that happen without having to watch the simulation run
                > > and try to stop it at just the right time?
                > >
                > > Thanks,
                > > Kevin
                > >
                > >
                > >
                >
                > --
                > View this message in context: http://old.nabble.com/NetLogo-Statistics-tp28082517p28083778.html
                > Sent from the NetLogo-Users mailing list archive at Nabble.com.
                >


              • EnricoC
                Hi Dan, I m trying to make it work too. I set the environment.plist as follows:
                Message 7 of 13 , Apr 7, 2010
                  Hi Dan,
                  I'm trying to make it work too. I set the environment.plist as follows:

                  <?xml version="1.0" encoding="UTF-8"?>
                  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                  <plist version="1.0">
                  <dict>
                  <key>JRI_HOME</key>
                  <string>/Library/Frameworks/R.framework/Resources/library/rJava/jri</string>
                  <key>R_HOME</key>
                  <string>/Library/Frameworks/R.framework/Resources</string>
                  </dict>
                  </plist>

                  and the R extension itself seems to work partially. I don't have the "runOnce: java.lang.NullPointerException " error anymore, and apparently you can get data from R.
                  For instance if you digit on NetLogo commandline:
                  show r:get "rnorm(10)"
                  You do get 10 random numbers as output.
                  However the problem I have is that i cannot send my data to R. The command:
                  r:put "a_number" 5
                  Will give me an error message:

                  java.lang.NoSuchMethodError: org.rosuda.JRI.Rengine.rniAssign(Ljava/lang/String;JJ)V
                  at org.netlogo.extension.r.HoldRengineX.storeObject(HoldRengineX.java:267)
                  at org.netlogo.extension.r.Entry$Put.perform(Entry.java:514)
                  at org.nlogo.prim._extern.perform(_extern.java:60)
                  at org.nlogo.nvm.Context.stepConcurrent(Context.java:95)
                  at org.nlogo.nvm.ConcurrentJob.step(ConcurrentJob.java:95)
                  at org.nlogo.job.JobThread.runPrimaryJobs(JobThread.java:194)
                  at org.nlogo.job.JobThread.run(JobThread.java:117)

                  Does anybody have any idea??
                  I'm sending this to the R extension developers but I'm afraid we need someone with a good knowledge of Java...

                  Enrico

                  --- In netlogo-users@yahoogroups.com, "Dan" <iknowkirk@...> wrote:
                  >
                  > This R extension looks great and just the sort of thing I have been looking for to provide some more complex realtime analysis of model behaviour.
                  >
                  > Unfortunately, I have been unable to get it working on the Mac version of netlogo - I know there website says as such, but in my mind it can't be too different from the Linux version.
                  >
                  > Currently I have insatlled the R package 'rJava', placed the R folder in the netlogo extensions folder and attempted to do the equivalent of the following 2 linux instructions:
                  >
                  > >>Then you have to set two global environment variables by typing:
                  > >>export R_HOME= <path to your R installation, e.g. /usr/lib/R>
                  > >>export JRI_HOME= <path to the jri-folder of the rJava library, e.g. >>/usr/lib/R/library/rJava/jri or /usr/local/lib/R/site-packages/jri>
                  >
                  > However, when i use the code extensions[r] in netlogo I receive the following error message:
                  > Error in runOnce: java.lang.NullPointerException
                  > My reading of this is that netlogo is simply not finding the extension.
                  >
                  > I would really like to get this to work, does anyone have any experience using the R extension on a Mac?
                  > Please don't make me go back to a windows machine just to use this :(
                  >
                  > Any advice, as ever, is much appreciated
                  > Thanks for reading
                  > Dan
                  >
                  >
                  >
                  > --- In netlogo-users@yahoogroups.com, rpietro <pietr007@> wrote:
                  > >
                  > >
                  > > http://netlogo-r-ext.berlios.de/ - works great
                  > >
                  > >
                  > > kez9a wrote:
                  > > >
                  > > > Hi everyone,
                  > > >
                  > > > I am trying to analyze the behavior of an adapted team assembly model.
                  > > > Does NetLogo have any built-in statistics features or can we just set up
                  > > > whatever plots we need?
                  > > >
                  > > > Also, is there a way to set a go button to go for a certain number of
                  > > > ticks? So if I want to run the simulation for 200 ticks, can I do
                  > > > something to make that happen without having to watch the simulation run
                  > > > and try to stop it at just the right time?
                  > > >
                  > > > Thanks,
                  > > > Kevin
                  > > >
                  > > >
                  > > >
                  > >
                  > > --
                  > > View this message in context: http://old.nabble.com/NetLogo-Statistics-tp28082517p28083778.html
                  > > Sent from the NetLogo-Users mailing list archive at Nabble.com.
                  > >
                  >
                • kez9a
                  Is there a way to do multiple replications in NetLogo and export a single csv file with the results of a plot? So if I want to do 25 replications of a run of
                  Message 8 of 13 , Apr 7, 2010
                    Is there a way to do multiple replications in NetLogo and export a single csv file with the results of a plot? So if I want to do 25 replications of a run of 200 simulations and export these results to excel to be analyzed, is there a way to do it other than running the model manually 25 times and exporting the plot each time?

                    Is this the kind of thing that the R extension can do? I still haven't been able to get it to work.

                    --- In netlogo-users@yahoogroups.com, "kez9a" <kez9a@...> wrote:
                    >
                    > James,
                    > Thanks so much. This is exactly what I needed. I figured there would be a way to do it, but couldn't find it in the documentation or previous group postings.
                    > Thanks again,
                    > Kevin
                    >
                    > --- In netlogo-users@yahoogroups.com, James Steiner <gregortroll@> wrote:
                    > >
                    > > You can use REPEAT in the button code, like this:
                    > >
                    > > REPEAT 200 [ GO ]
                    > >
                    > > Of course, turn off "Forever" in the button, so the REPEAT is run only once.
                    > >
                    > > You could also make a procedure that does the repeating for you. While your
                    > > at it, you might have it run setup, too, and then do your final bookkeeping,
                    > > if there is any.
                    > >
                    > > to start-200
                    > > setup
                    > > repeat 200 [ go ]
                    > > finish
                    > > end
                    > >
                    > > ~~James
                    > >
                    > > On Thu, Apr 1, 2010 at 2:53 AM, kez9a <kez9a@> wrote:
                    > >
                    > > > Thanks for the information. Does the R extension allow you to run a
                    > > > specific number of ticks (not just once or forever)? Is there a way to do
                    > > > this in NetLogo?
                    > >
                    >
                  • Sean Downey
                    For what it s worth, I applaud your efforts getting R-NetLogo integration working well across platforms. It really opens up endless possibilities for analyzing
                    Message 9 of 13 , Apr 7, 2010
                      For what it's worth, I applaud your efforts getting R-NetLogo
                      integration working well across platforms. It really opens up endless
                      possibilities for analyzing models, just like the "shell" command-line
                      interface. I'd love to see it eventually as one of the "standard"
                      extensions that comes with the NetLogo releases.

                      -Sean
                      > ._,___

                      --
                      Sean S. Downey
                      Department of Anthropology, Stanford University
                      School of Anthropology, University of Arizona

                      sean@...
                      http://www.u.arizona.edu/~sdowney <http://www.u.arizona.edu/%7Esdowney>
                      916-623-5493
                      Mailing Address:
                      5251 West El Camino Del Cerro
                      Tucson, AZ 85725
                    • jthiele
                      Dear all, please let me make some remarks on the extension: 1. If you re working on a windows machine and not able to get the extension running (after reading
                      Message 10 of 13 , Apr 7, 2010
                        Dear all,

                        please let me make some remarks on the extension:

                        1. If you're working on a windows machine and not able to get the extension
                        running (after reading the documentation), please see at first the
                        (currently very short) FAQ in the extensions Wiki at:
                        http://openfacts2.berlios.de/wikien/index.php/BerliosProject:NetLogo-R-Extension:FAQ

                        If you checked this and you're still not able to get it running, please
                        contact me via email directly. If we will find something of general interest
                        I will append the FAQ list.

                        2. If you're interested in using the extension on your Mac OS please note:
                        I've absolutly no experiences with Mac OS and have no hardware for testing.
                        But I will try to get it working together with Enrico (hopefully). If we can
                        find something out, we will inform you via this thread.

                        3. We have developed an R Package for using NetLogo from R as well (means
                        the opposite direction, it's working like the Mathematica Link). It's
                        currently an early beta version. If you're interested in testing this,
                        please let me know. It's easier to install (doesn't need environment
                        variables). Especially, we are looking for people who have nice use cases
                        which we can use as examples of usage. Please contact me directly via email
                        for this.

                        Any questions and remarks are very welcome. If you like, contact me directly
                        via email (but please understand that an answer could take some days :-)).

                        Best wishes and have fun using NetLogo and R,

                        Jan C. Thiele





                        Enrico R. Crema wrote:
                        >
                        > Hi Dan,
                        > I'm trying to make it work too. I set the environment.plist as follows:
                        >
                        > <?xml version="1.0" encoding="UTF-8"?>
                        > <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
                        > "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                        > <plist version="1.0">
                        > <dict>
                        > <key>JRI_HOME</key>
                        >
                        > <string>/Library/Frameworks/R.framework/Resources/library/rJava/jri</string>
                        > <key>R_HOME</key>
                        > <string>/Library/Frameworks/R.framework/Resources</string>
                        > </dict>
                        > </plist>
                        >
                        > and the R extension itself seems to work partially. I don't have the
                        > "runOnce: java.lang.NullPointerException " error anymore, and apparently
                        > you can get data from R.
                        > For instance if you digit on NetLogo commandline:
                        > show r:get "rnorm(10)"
                        > You do get 10 random numbers as output.
                        > However the problem I have is that i cannot send my data to R. The
                        > command:
                        > r:put "a_number" 5
                        > Will give me an error message:
                        >
                        > java.lang.NoSuchMethodError:
                        > org.rosuda.JRI.Rengine.rniAssign(Ljava/lang/String;JJ)V
                        > at
                        > org.netlogo.extension.r.HoldRengineX.storeObject(HoldRengineX.java:267)
                        > at org.netlogo.extension.r.Entry$Put.perform(Entry.java:514)
                        > at org.nlogo.prim._extern.perform(_extern.java:60)
                        > at org.nlogo.nvm.Context.stepConcurrent(Context.java:95)
                        > at org.nlogo.nvm.ConcurrentJob.step(ConcurrentJob.java:95)
                        > at org.nlogo.job.JobThread.runPrimaryJobs(JobThread.java:194)
                        > at org.nlogo.job.JobThread.run(JobThread.java:117)
                        >
                        > Does anybody have any idea??
                        > I'm sending this to the R extension developers but I'm afraid we need
                        > someone with a good knowledge of Java...
                        >
                        > Enrico
                        >
                        > --- In netlogo-users@yahoogroups.com, "Dan" <iknowkirk@...> wrote:
                        >
                        >

                        --
                        View this message in context: http://old.nabble.com/NetLogo-Statistics-tp28082517p28169702.html
                        Sent from the NetLogo-Users mailing list archive at Nabble.com.
                      • jthiele
                        Dear Mac-Users, Enrico and I have been able to fix the problems running the extension on Mac OS. I will include the bug fix in the next days and will update
                        Message 11 of 13 , Apr 8, 2010
                          Dear Mac-Users,

                          Enrico and I have been able to fix the problems running the extension on Mac
                          OS. I will include the bug fix in the next days and will update the binaries
                          hosted on Berlios (but not before Sunday!).

                          Best wishes,

                          Jan C. Thiele
                          --
                          View this message in context: http://old.nabble.com/NetLogo-Statistics-tp28082517p28178274.html
                          Sent from the NetLogo-Users mailing list archive at Nabble.com.
                        Your message has been successfully submitted and would be delivered to recipients shortly.