Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How to turn long output collection into list?' topicStudent Support Forum > General > "How to turn long output collection into list?"

Next Comment >Help | Reply To Topic
Author Comment/Response
Sebastian
05/17/12 12:24pm

Hey all!

I'm trying to run a simulation in NetLogo and use its connection to mathematica to do some analysis. In short, I'm trying to run the simulation repeatedly, and collect data after each iteration. the idea is next to use that output in order to graph its distribution.

Here is the Do loop I'm using:

Do[{NLCommand["set NumberOfPatients 500", "set NumberOfDoctors 10",
"no-display", "setup", "cooperate"],
NLDoCommandWhile["go", "ticks < 300"];,
Print[NLReport[
"sum [health] of patients with [color != black]"]]}, {100}]

it gives me output like this:

2220.37

1789.71

2117.39

...

but I will have 100s of outputs, so need it in a list in order to work with it.

Any ideas on how I can turn the output into a list?

Thanks in advance!

Seb

URL: ,

Subject (listing for 'How to turn long output collection into list?')
Author Date Posted
How to turn long output collection into list? Sebastian 05/17/12 12:24pm
Re: How to turn long output collection into list? Bill Simpson 05/18/12 5:56pm
Re: Re: How to turn long output collection into... Sebastian 05/21/12 09:57am
Re: How to turn long output collection into list? yehuda ben-s... 05/20/12 03:19am
Re: Re: How to turn long output collection into... Sebastian 05/21/12 09:33am
Re: How to turn long output collection into list? Michael 05/23/12 08:21am
Next Comment >Help | Reply To Topic