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

Behaviour Space and Turtle Variables

Expand Messages
  • w.ccarleton
    I ve been reading through the threads here on Behaviour Space and did find a cumbersome work-around to my question, but I figured I d ask anyway in case
    Message 1 of 4 , Jan 31, 2008
    • 0 Attachment
      I've been reading through the threads here on Behaviour Space and did
      find a cumbersome work-around to my question, but I figured I'd ask
      anyway in case something has changed. I need to export a spreadsheet
      at the end of a run that lists the who of each turtle and then the
      value of a series of variables for each turtle. Right now I'm doing it
      with export-output, but then I have to rearrange everything and place
      it into a spreadsheet manually. After a thousand or more runs that
      will mean hours of typing. Has anyone programmed an extension to
      provide those kinds of outputs? If not, can someone tell me where to
      go for a good guide with Java programming relevant to NetLogo so I can
      code an extension myself?

      Also, I want to generate a plot that shows variable/variable rather
      than variable/time. Can anyone tell me how to do that? Thanks,

      Chris
    • Seth Tisue
      ... w I ve been reading through the threads here on Behaviour Space and w did find a cumbersome work-around to my question, but I figured I d w ask anyway
      Message 2 of 4 , Feb 1, 2008
      • 0 Attachment
        >>>>> "w" == w ccarleton <w.ccarleton@...> writes:

        w> I've been reading through the threads here on Behaviour Space and
        w> did find a cumbersome work-around to my question, but I figured I'd
        w> ask anyway in case something has changed. I need to export a
        w> spreadsheet at the end of a run that lists the who of each turtle
        w> and then the value of a series of variables for each turtle. Right
        w> now I'm doing it with export-output, but then I have to rearrange
        w> everything and place it into a spreadsheet manually. After a
        w> thousand or more runs that will mean hours of typing. Has anyone
        w> programmed an extension to provide those kinds of outputs? If not,
        w> can someone tell me where to go for a good guide with Java
        w> programming relevant to NetLogo so I can code an extension myself?

        You may not need to write Java code; probably you can just write NetLogo
        code that generates the output you want. Can you show us what kind of
        CSV output you want to generate?

        Even if you decide that you want to involve some other programming
        language to get the output in the format you want, it's probably not
        necessary to do it in the form of a NetLogo extension. You could just
        let NetLogo generate output in whatever form is easiest to generate, and
        then write a separate program, in any programming language you want,
        that you would run separately in order to postprocess the files in
        whatever way you want.

        w> Also, I want to generate a plot that shows variable/variable rather
        w> than variable/time. Can anyone tell me how to do that? Thanks,

        Use the PLOTXY command instead of PLOT and give it whatever x and y
        coordinates you want to plot.

        --
        Seth Tisue / http://tisue.net
        lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/
      • w.ccarleton
        ... I m looking to have the output give the who of each turtle (number of turtles defined by user with a slider) in one column and two variables that
        Message 3 of 4 , Feb 1, 2008
        • 0 Attachment
          --- In netlogo-users@yahoogroups.com, Seth Tisue <seth@...> wrote:
          I'm looking to have the output give the who of each turtle (number of
          turtles defined by user with a slider) in one column and two variables
          that turtles-own in adjacent columns so that I can read across and
          manipulate with excel or a stats program. Such as;

          Who#,variable1,variable2
          turtle25,1000,1000
          etc.

          Thanks for the help Seth - much appreciated.

          C

          > >>>>> "w" == w ccarleton <w.ccarleton@...> writes:
          >
          > w> I've been reading through the threads here on Behaviour Space and
          > w> did find a cumbersome work-around to my question, but I figured I'd
          > w> ask anyway in case something has changed. I need to export a
          > w> spreadsheet at the end of a run that lists the who of each turtle
          > w> and then the value of a series of variables for each turtle. Right
          > w> now I'm doing it with export-output, but then I have to rearrange
          > w> everything and place it into a spreadsheet manually. After a
          > w> thousand or more runs that will mean hours of typing. Has anyone
          > w> programmed an extension to provide those kinds of outputs? If not,
          > w> can someone tell me where to go for a good guide with Java
          > w> programming relevant to NetLogo so I can code an extension myself?
          >
          > You may not need to write Java code; probably you can just write NetLogo
          > code that generates the output you want. Can you show us what kind of
          > CSV output you want to generate?
          >
          > Even if you decide that you want to involve some other programming
          > language to get the output in the format you want, it's probably not
          > necessary to do it in the form of a NetLogo extension. You could just
          > let NetLogo generate output in whatever form is easiest to generate, and
          > then write a separate program, in any programming language you want,
          > that you would run separately in order to postprocess the files in
          > whatever way you want.
          >
          > w> Also, I want to generate a plot that shows variable/variable rather
          > w> than variable/time. Can anyone tell me how to do that? Thanks,
          >
          > Use the PLOTXY command instead of PLOT and give it whatever x and y
          > coordinates you want to plot.
          >
          > --
          > Seth Tisue / http://tisue.net
          > lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/
          >
        • Seth Tisue
          ... w --- In netlogo-users@yahoogroups.com, Seth Tisue wrote: w I m looking to have the output give the who of each turtle (number w of turtles
          Message 4 of 4 , Feb 1, 2008
          • 0 Attachment
            >>>>> "w" == w ccarleton <w.ccarleton@...> writes:

            w> --- In netlogo-users@yahoogroups.com, Seth Tisue <seth@...> wrote:
            w> I'm looking to have the output give the who of each turtle (number
            w> of turtles defined by user with a slider) in one column and two
            w> variables that turtles-own in adjacent columns so that I can read
            w> across and manipulate with excel or a stats program. Such as;

            w> Who#,variable1,variable2 turtle25,1000,1000 etc.

            file-open "myfile.txt"
            foreach sort turtles [
            ask ? [
            file-print (word who "," variable1 "," variable2)
            ]
            ]
            file-close

            --
            Seth Tisue / http://tisue.net
            lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/
          Your message has been successfully submitted and would be delivered to recipients shortly.