chathika / NL4Py

Bringing Your Turtles From NetLogo to Python 🐍🐢
GNU General Public License v3.0
51 stars 10 forks source link

Get patches and plot #10

Closed ghost closed 4 years ago

ghost commented 4 years ago

I've just checked the arxiv document, and the YouTube video. Is it possible to get and plot NetLogo patches via this package (like it was in RNetLogo by NLGetPatches)?

chathika commented 4 years ago

@ewirth yes, you can export the patches view using: nl4py.NetLogoHeadlessWorkspace.exportView(str image_name.png) . For example:

n = nl4py.newNetLogoHeadlessWorkspace()
n.openModel("MyModel.nlogo")
n.command("setup")
n.exportView("patches.png")