[starlogo-users] newbie - Data import-output and discrete random
Francisco J. Zagmutt
gerifalte28 at hotmail.com
Wed May 11 17:50:58 EDT 2005
Thanks a lot for your prompt reply Gordon! So I guess that I still need to
find out about data importing and custom functions. As you said,
incorporating a pseudo-random number generator in the code is one option.
In the other hand it might be a little to "expensive" since I would have to
use a loop and this usually uses a lot of resources and interpreter time.
Also, several discrete functions relay on factorial calculations and I think
that factorial is not available in StarLogo (I could not find it in the math
commands list). That is why I was thinking on maybe using custom functions
from a lower level language (although I would rather avoid doing that!). I
read today that NetLogo can implement Java "extensions".
>From: Gordon McDonough <gordo at hubwest.com>
>To: "Francisco J. Zagmutt" <gerifalte28 at hotmail.com>
>Subject: Re: [starlogo-users] newbie - Data import-output and discrete
>random number generation
>Date: Tue, 10 May 2005 21:24:26 -0600
>Francisco J. Zagmutt wrote:
>>- Can external data be imported in the models? For example, can I import
>>actual x,y coordinates to be used as turtles and patches?
>Great question! for minds better than mine. :)
>>- Is distance calculated considering a flat surface? i.e. no adjustment
>>for sphericity of the globe
>The canvas is flat, and the 'nowrap' instruction will let you measure
>across it without finding the shortcuts across the edges.
>>- Does StarLogo support random number generation other than Gaussian and
>>uniform? For example; is it possible to randomly generate numbers from
>>binomial or Poisson distributions?
>It is pretty easy to put math into your code, so if you have a pseudorandom
>generator you prefer, it can be put in.
>>- Can detailed simulation output (other than graphs and pictures) be saved
>>on the fly? Can numerical output be saved in flat files or any other
>>format for posterior analyses?
>YES! Using 'print' will place data in the output window and follow it with
>a carriage return, making it easily exportable to a spreadsheet or another
>>- In case that some of these capabilities are not available; is there a
>>way to implement custom functions in other language (i.e. JAVA, C,
>>FORTRAN) and call them from StarLogo? For example, to calculate an exact
>>binomial probability one would need a factorial function which apparently
>>does not currently exist in StarLogo.
>>- Is there a general "rule of thumb" for the maximum number of turtles
>>that StarLogo can handle well?
>No computer will ever run fast enough some of the time. How much time do
>you have? I have started programs with many thousands of agents and let it
>run for several days at a time to see what happens. Usually, increasing
>the number of agents just slows down the program, although sometimes (e.g.
>A particularly complicated setup procedure) a huge number might be more
>likely to stop the program, or if there are complicated places in a program
>it can make it appear as though the program is not working. There are bugs
>that I write unintentionally too. For example, having every turtle
>unnecessarily manipulate a global variable can bog a program down. Will
>every hundredth do just as well? Or one every cycle (turtle who # 0)
>I hope this helps a little bit, if you need more help, let us know, show us
>some code, etc.
>Santa Fe, NM
>Equally to be loved
>Equally a coming Buddha
More information about the starlogo-users