It is done to control Netlogo from python on the Ubuntu system.
Netlogo is a helpful visual tool for multi-agent simulation.
However, it is challenging to analyze further the agent behaviors and action policies.
Python is a better choice to cover Netlogo. Furthermore,
it can easily construct a reinforcement learning mechanism for policy enhancement.
The point is to build an efficient shared environment for these two.
After many trials, I used Jpype and pyNetlogo in the latest Ubuntu system.
How to build pyNetlogo environment in Ubuntu
Install anaconda
To download the latest anaconda installation package.
https://www.anaconda.com/products/distribution#linux
ref: https://blog.eldernode.com/setup-anaconda-on-ubuntu-22-04/
1 |
|
To create a desktop shortcut for Anaconda Navigator
ref: https://www.how2shout.com/linux/create-anaconda-navigator-desktop-shortcut-ubuntu-20-04-18-04/
Generate pyNetlogo env in anaconda
Intsall numpy, scipy, pandas
In terminal, $ conda activate pyNetlogo
Install JPype
Because JPype is not in conda list, confirm it in the official site.
1 |
|
note: JPype can not work in Python 3.9, but fine in 3.8.
Install pyNetlogo
ref: https://pynetlogo.readthedocs.io/en/latest/install.html
note: pyNetLogo requires NumPy, SciPy, Pandas and JPype packages.
1 |
|
note: do it later.change in core.py of pyNetlogo
Install Java JDK
ref: here
1 |
|
Choose JDK17 to install.
The Java installation costs time.
After installation, check the Java version: $ java –version
End processes while error.
$ gnome-system-monitor
Summary
Key steps of installation:
1 |
|
Notes:
(1) JPype does not work on Python 3.9, but fine on 3.8.
(2) Skip JDK19 trial while JDK17 works.