Science Score: 20.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: sciencedirect.com -
✓Committers with academic emails
5 of 8 committers (62.5%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.6%) to scientific vocabulary
Keywords
Repository
Bringing Your Turtles From NetLogo to Python 🐍🐢
Basic Info
Statistics
- Stars: 52
- Watchers: 8
- Forks: 9
- Open Issues: 6
- Releases: 0
Topics
Metadata Files
Readme.md
NL4Py
A Python controller interface to NetLogo. NL4Py uses a Remote Procedure Call architecture, allowing Python client code to control NetLogo workspaces on a NetLogoWorkspaceController server. NL4Py supports controlling multiple workspaces through a single Python client.
Read the NL4Py article is on SoftwareX: https://www.sciencedirect.com/science/article/pii/S2352711021001035
NL4Py has been tested Python 3.6.2
Requirements
- NL4Py works with NetLogo 6.0, 6.1, and 6.2
- NL4Py requires JDK 1.8
- NL4Py requires py4j to be installed with your Python distrubtion
Installation
You can install NL4Py using pip-tools:
pip install nl4py
Usage
To use nl4py in your python code use:
python
import nl4py
And start the NetLogoControllerServer with:
python
nl4py.initialize(netlogo_home : str)
Where netlogo_home refers to the top level directory of your NetLogo installation.
Examples
- Example1 : An example of how to run concurrent NetLogo models. To run this example enter the number of desired concurrent runs and the path to your netlogo installation as command line arguments:
python Example1_NRunsOfFireSampleModel.py 200 "C:\Program Files\NetLogo 6.0.4"
- Example2 : An example of how to schedule reporters to return simulation state over a range of ticks at a custom tick interval. To run pass in the path to your netlogo installation as a command line argument:
python Example2_ScheduledReporters.py 200 "C:\Program Files\NetLogo 6.0.4"
- Example3 : An example of how to run_experiment can be used to easily execute an experiment with parameter variation and return results of multiple reporters. To run pass in the path to your netlogo installation as a command line argument:
python Example3_NRunsOfFireRunExperiment.py 20 "C:\Program Files\NetLogo 6.0.4"
- Example4 : An example of how to control the NetLogoGUI. To run pass in the path to your netlogo installation as a command line argument:
python Example4_NetLogoGUIAppControl.py "C:\Program Files\NetLogo 6.0.4"
Also, see these demo jupyter notebooks:
Functions
You can create multiple NetLogo HeadlessWorkspaces from Python using the netLogoWorkspaceFactory:
python
nl4py.create_headless_workspace() -> nl4py.NetLogoHeadlessWorkspace.NetLogoHeadlessWorkspace
The following HeadlessWorkspace functions are available:
python
nl4py.NetLogoHeadlessWorkspace.NetLogoHeadlessWorkspace.open_model(self, path : str)
nl4py.NetLogoHeadlessWorkspace.NetLogoHeadlessWorkspace.close_model(self)
nl4py.NetLogoHeadlessWorkspace.NetLogoHeadlessWorkspace.command(self, command : str)
nl4py.NetLogoHeadlessWorkspace.NetLogoHeadlessWorkspace.report(self, reporter : str) -> str
nl4py.NetLogoHeadlessWorkspace.NetLogoHeadlessWorkspace.schedule_reporters(self, reporters : list, startAtTick : int = 0,
intervalTicks : int = 1, stopAtTick : int = -1, goCommand : str = 'go') -> list
nl4py.NetLogoHeadlessWorkspace.NetLogoHeadlessWorkspace.set_params_random()
nl4py.NetLogoHeadlessWorkspace.NetLogoHeadlessWorkspace.get_param_names()
nl4py.NetLogoHeadlessWorkspace.NetLogoHeadlessWorkspace.get_param_ranges()
To open the NetLogo application in GUI mode use:
python
nl4py.netlogo_app() -> nl4py.NetLogoGUI.NetLogoGUI
Referencing:
Please cite as: Gunaratne, C., & Garibay, I. (2021). NL4Py: Agent-based modeling in Python with parallelizable NetLogo workspaces. SoftwareX, 16, 100801.
NL4Py is based off of David Masad's Py2NetLogo, available at: https://github.com/dmasad/Py2NetLogo
Copyright
Copyright (C) 2018 Chathika Gunaratne, Complex Adaptive Systems Lab, University of Central Florida.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Owner
- Name: Chathika Gunaratne
- Login: chathika
- Kind: user
- Company: Oak Ridge National Laboratory
- Repositories: 15
- Profile: https://github.com/chathika
Make turtles, Munge data, Model societies. I also work here: https://gitlab.com/chathika
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| chathika | c****e@g****m | 634 |
| chathika | c****a@m****u | 31 |
| Chathika Gunaratne | c****5@u****u | 18 |
| root | r****t@l****v | 3 |
| David Masad | d****d@g****m | 2 |
| Chathika | g****s@o****v | 2 |
| Elizabeth E. Esterly | e****h@c****u | 1 |
| Elizabeth E. Esterly | e****y@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 14
- Total pull requests: 5
- Average time to close issues: 7 months
- Average time to close pull requests: 3 minutes
- Total issue authors: 14
- Total pull request authors: 1
- Average comments per issue: 1.71
- Average comments per pull request: 0.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ChaoKing2020 (1)
- Westlife1002 (1)
- wmirecon (1)
- AyeshaZehra (1)
- selforganizing (1)
- robertosilviu (1)
- LaCuneta (1)
- WesselDeZeeuw (1)
- bevsxyz (1)
- brandon-fsu (1)
- LuxMiranda (1)
- bryanpiguave (1)
- ghost (1)
- NedaMarvasti (1)
Pull Request Authors
- chathika (5)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 303 last-month
- Total dependent packages: 2
- Total dependent repositories: 2
- Total versions: 44
- Total maintainers: 1
pypi.org: nl4py
A NetLogo connector for Python.
- Homepage: https://github.com/chathika/NL4Py
- Documentation: https://nl4py.readthedocs.io/
- License: GPL
-
Latest release: 0.9.0
published over 4 years ago
Rankings
Maintainers (1)
Dependencies
- matplotlib *
- numpy *
- pandas *
- psutil *
- py4j *