creating a large list from an inputfile

This is a discussion on creating a large list from an inputfile within the logo forums in Programming Languages category; Hello, I am trying to simulate the solution of a dynamic state variable model in Netlogo. The solution is a multidimensional array of a rather large size, like 1000 by 40 by 1000, for example (can be much larger something like 1000 by 500 by 1000 by 40). I found this example, set patch-data sentence patch-data (list (list file-read file-read file-read)) in the example set, which create an arbitrary N by 3 array, I suppose. If I want to apply this example to 1000-40-1000 case, do I do (list "(list "file-read x1000 times")"x40 times) .... maybe this does not make ...

Go Back   Application Development Forum > Programming Languages > logo

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 01-08-2005, 08:23 PM
Phidippus
Guest
 
Default creating a large list from an inputfile

Hello,

I am trying to simulate the solution of a dynamic state variable model
in Netlogo. The solution is a multidimensional array of a rather large
size, like 1000 by 40 by 1000, for example (can be much larger
something like 1000 by 500 by 1000 by 40).

I found this example,

set patch-data sentence patch-data (list (list file-read file-read
file-read))


in the example set, which create an arbitrary N by 3 array, I suppose.
If I want to apply this example to 1000-40-1000 case, do I do


(list "(list "file-read x1000 times")"x40 times)

.... maybe this does not make sense... I am not exactly sure how to
describe what I am thinking of. But actually putting such code seems
very ugly even if it worked.

Is there any easy way to do this? I can format the input file in anyway
it should be. In fact, if I could just create the input file as a form
of list (i.e., file contain the structured list), it is easier.
Thank you so much.
Phidippus

Reply With Quote
  #2  
Old 01-08-2005, 10:00 PM
Brian Harvey
Guest
 
Default Re: creating a large list from an inputfile

"Phidippus" <mopthisandthat@hotmail.com> writes:
> In fact, if I could just create the input file as a form
>of list (i.e., file contain the structured list), it is easier.


Yes, this is exactly what you should do: write your file so that it is
structured with brackets, like this:

[[[1 2 3]
[4 5 6]]
[[7 8 9]
[10 11 12]]]

(The spacing and line separation is just to help you read it; only the
brackets matter to Logo.) Then a single file-read will read the entire
list.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 11:52 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.