Skip to content

Python Extension alpha

Pre-release
Pre-release

Choose a tag to compare

@qiemem qiemem released this 16 Nov 15:33
· 9 commits to master since this release

Installation instructions

  1. Download the attached zip
  2. Unzip it into the extensions directory of your NetLogo installation.

Warning: This extension is untested on windows. There's a chance it will work if you just do py:setup "python.exe" or something, but I haven't tried

Demo models can be found in the demos folder. By default, they use Python 3. If you only have Python 2, simply change the line that reads py:setup "python3" to py:set "python".

The demo models depend on a number of libraries, all installable with pip:

Flocking Clusters

  • numpy
  • sklearn

Both Wolf Sheep Predation models

  • numpy
  • matplotlib

Traffic Basic - Reinforcement

  • numpy
  • tensorflow
  • keras

To install all dependencies, run pip install numpy matplotlib sklearn tensorflow keras in your terminal (assuming you have pip).

Changelist

Features:

  • New primitives for referencing correct Python installation in system independent way: py:python, py:python2, and py:python3
  • New configuration file and menu for configuring default Python installations to use
  • Much faster data transfer between Python and NetLogo

Bug fixes:

  • Fail gracefully on NaN and Infinity