dmp
dmp

Reputation: 1

Using more than one reporter in NLDoReport[] (running NetLogo simulations from Mathematica)

I am running NetLogo simulations from Mathematica.

I need to run a simulation and store the values of 2 attributes in each tick during this simulation.

By running the command below, I could get a Mathematica list with the values of a single attribute (house_price of location 1):

NLDoReport["go", "[house_price] of location 1", 200]

However, I do not know how to do the same thing for more than one attribute. I tried to pass a list o reporters, as below, but it did not work.

NLDoReport["go", {"[house_price] of location 1", "[population] of location 1"}, 200]

Does anyone know how to do this?

Upvotes: 0

Views: 24

Answers (1)

Wade Schuette
Wade Schuette

Reputation: 1473

So your syntax is NLDoReport["go", reporter, count]. I think if you define a reporter routine in Netlogo that combines the data you need into a list, and call that reporter, it should work. ( I don't have mathematica to try this out.) Something like this ( or similar with whatever syntax works in NetLogo to return your desired list ).

In NetLogo:

to-report mydata
 let mylist list [house-price] of location 1 [population] of location 1
 report mylist
end

in Mathematica:

 NLDoReport["go", mydata, 200]

Upvotes: 1

Related Questions