Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Connecting NetLogo Desktop with NetLogo Web

34 views
Skip to first unread message

Duvan Otalora

unread,
Dec 26, 2024, 11:03:57 PM12/26/24
to netlogo-devel

Hello everyone,

I hope this message finds you well.

I am currently working on a web application where I need to integrate NetLogo with support for the GIS extension. Unfortunately, the web version of NetLogo does not support this extension. I am exploring the possibility of running NetLogo Desktop on a server and exposing Netlogo web interface to allow for seamless interaction and information flow.

Given that the TeleTortoise project seems to be abandoned, I was wondering if anyone could provide guidance or suggestions on how to implement this solution.

Thank you in advance for your support and collaboration.

Best regards,
Héctor Otálora

Chris Davis Perumal

unread,
Jan 2, 2025, 1:52:59 PMJan 2
to netlogo-devel
Hi Duvan,

Our team had a similar problem with the limitations of NetLogo Web, we wanted to have NetLogo (the desktop version) running on a server and expose REST APIs that would interact with our NetLogo files, run simulations and return the results to the browser.

The best way to do is via the Controlling API. We used the following documentation:
We needed a web framework to do the handling to interact with the NetLogo files and run it in a headless format. Since the API was already in Java, we chose a Java based web framework and imported these libraries to allow us to access.

It take some work to setup but it's definitely possible. I hope this was helpful. 

Regards,
Chris

Franco Bagnoli

unread,
Jan 3, 2025, 10:13:46 AMJan 3
to Duvan Otalora, netlogo-devel
I've done something similar to what you describe in order to use hubnet from a web interface (embedded inside another frame). 

You need a linux server (so you do not have to share the main display), a vnc server (Turbo VNC), a proxy server that allows to embed the vnc connection on http (TurboVNC does the job), an HTML5 vnc client (noVNC), and some tools to manipulate windows automatically (xdotool).

You launch a virtual X server (without window server, only NetLogo) and export it via vnc using the vncserver command of TurboVNC 

/opt/TurboVNC/bin/vncserver -novnc /usr/share/novnc -geometry 438x310+0+0 -xstartup /usr/local/bin/NetLogo

(I used to launch HebNetClient instead of NetLogo). The geometry is needed to adapt the window to your application. 

Then you can connect to the server via the url provided by TurboVNC, for instance


The problem is that the HubNetClient (and I think also NetLogo) open their window in a fixed position and not comply with the xwindow standard-geometry option, but one can use xdotool 

xdotool search --name --onlyvisible NetLogo windowmove 0 0 

If one uses linux inside a virtualbox one has to export port 5801 to the external world (and if one has to allow clients from other machines one has to disable the firewall for these ports and use a ssh tunnel to export the port to the outside world (if one has access to a public server), or mont all the stuff to a publicly accessible server. 

In this way it is possible to use the desktop version of netlogo and also the hubnet client from tablets or other android/iphone devices. 


--
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 netlogo-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/netlogo-devel/33f1fe83-514a-45c3-83e7-cf07516ae247n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages