Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get NetLogo widgets in headless mode

Tags:

netlogo

I need to get the list of all defined widgets in a nlogo script in headless mode. I basically need to the targeted variables and the default values. But I just find private methods in the API to achieve this (https://github.com/NetLogo/NetLogo/blob/5.x/src/main/org/nlogo/headless/HeadlessModelOpener.scala#L136-L234). Is there a public method from the API to achieve this ? Thanks

like image 507
Mathieu Avatar asked Nov 29 '25 14:11

Mathieu


1 Answers

Mike Horn solved this by parsing through the .nlogo file in his NetTango project. If you're okay with that, take a look at his Model.java load() method, and initSlider(), initSwitch(), and initPlot() methods. I don't remember the exact relative line location of default value for the other widget types, but if you open a .nlogo file in a text editor, you should be able to figure it out.

like image 50
Arthur Hjorth Avatar answered Dec 02 '25 05:12

Arthur Hjorth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!