Mr. Sempere,

NetLogo uses Java classes to run the simulation. These Java classes adhere 
to interfaces (scala's terminology calls them "traits") found in the 
org.nlogo.api 
<https://ccl.northwestern.edu/netlogo/docs/scaladoc/org/nlogo/api/index.html> 
package. The easiest way to inspect the world is to get the world (using 
workspace.world()) and to access objects using methods on the world 
interface. 
<https://ccl.northwestern.edu/netlogo/docs/scaladoc/org/nlogo/api/World.html>

A few words of caution about using world directly:

   - Although world has more methods than are found on the interface linked 
   above, we generally recommend not using those methods as they may be 
   changed between NetLogo releases. If you include the NetLogo jar with your 
   program (and so have control over when the version changes) this is less of 
   an issue.
   - World and its various members are *not* thread-safe. You should not 
   attempt to access them if a call to workspace.command or workspace.report 
   is in progress.
   - Directly altering any values on world or its various members is very 
   likely to break reproducibility. 

Hope that helps! Please feel free to post any follow-up questions you have 
on this topic.


Thanks,

Robert


I have developed a java program that invokes a netlogo written agent model. 
> I am using workspace.command ("set var <value>") for setting variables and 
> "workspace.report("var") to get results. The string to set the value and 
> the string received shall be converted using DoubletoString() and 
> parseDouble ().
>
> My question is the following. There is a direct method to access netlogo 
> variables without requiring such conversion through some java classes 
> contained in netlogo libraries? It could be used to acess not only simple 
> variables but also agents and lists? Whereas the code of Netlogo is 
> accessible it seems too large number of files to finding it easily.
>
> Any guiding suggestion will be very helpful.
>

-- 
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to