# Project nelogopy
nelogopy : Usage netlogo by python
## Developer by
- BOUAZIZ Nourddine : [@Bouaziz19](https://github.com/Bouaziz19)
## Installation
1- install netlogo 🔗
[![Netlogo](https://ccl.northwestern.edu/netlogo/images/netlogo-title-wide-60.jpg)](https://ccl.northwestern.edu/netlogo/download.shtml)
2-install nelogopy
```bash
conda install openjdk -y
pip install nelogopy
pip install nelogopy --upgrade
```
3- VS Code
Set Default Terminal In VS Code :Command Line Interface (CLI)
[🔗](https://www.w3schools.io/editor/vscode-change-default-terminal/)
[🔗](https://stackoverflow.com/questions/44435697/change-the-default-terminal-in-visual-studio-code)
## Example TEST
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
n.close_model()
```
## Colors
Colors
![Colors](https://ccl.northwestern.edu/netlogo/docs/images/colors.jpg)
## Usage/Examples
1- pyturtle
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
n.close_model()
```
2-set_background
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
path_image ="path/to/image/nelogopy.png"
# path_image= "C:/Nouveau dossier/nelogopy/Examples/nelogopy.png"
set_background(n,path_image)
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
n.close_model()
```
3-street
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
n.close_model()
```
4-Fd
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
car01.fd(1)
n.close_model()
```
5-netlogoshow
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
word=str(car01.id) +" " +str(i)
netlogoshow(n,word)
print(word)
car01.fd(1)
n.close_model()
```
6-distanceto
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
car01.fd(1)
word=car01.distanceto(car02)
print(word)
netlogoshow(n,word)
n.close_model()
```
7-face_to
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
car01.fd(1)
if i==5:
car01.face_to(car02)
n.close_model()
```
8-move_to
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
car01.fd(1)
if i==5:
car01.move_to(car02)
n.close_model()
```
9-hideturtle
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
car01.fd(1)
if i==5:
car01.hideturtle()
n.close_model()
```
10-set_shape
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,100):
time.sleep(1)
print("*********** ",i," ********")
car01.fd(1)
if i==5:
car01.set_shape('default')
n.close_model()
```
11-getxyturtle
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
car01.fd(1)
xy=getxyturtle(n,car01)
x=xy[0]
y=xy[1]
print("xy : ",xy)
print("x : ",x)
print("y : ",y)
n.close_model()
```
12-setxy
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,100):
time.sleep(1)
print("*********** ",i," ********")
car01.fd(1)
if i==5:
car01.setxy(10,10)
n.close_model()
```
13-distancebetween
```python
import time
from nelogopy.nelogopy import *
if __name__ == "__main__" :
# Change netlogo_home
netlogo_home="C:/Program Files/NetLogo 6.2.2"
n=run_netlogo(netlogo_home)
# Resize world
resize_world(n,0,60,0,60)
# Change path fo image
car01=pyturtle(n,x=20,y=20,shape="car",size_shape=4,color=15,name="car01",labelcolor=15)
car02=pyturtle(n,x=5,y=5,shape="car",size_shape=4,color=55,name="car02",labelcolor=55)
street( n,fromm=car01,too=car02,label="street",labelcolor=35,color=35,shape="aa",thickness=0.5)
for i in range(0,10):
time.sleep(1)
print("*********** ",i," ********")
car01.fd(1)
word=distancebetween(n,car01,car02)
print(word)
n.close_model()
```
Raw data
{
"_id": null,
"home_page": "",
"name": "nelogopy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,netlogo,simulation,multi agent",
"author": "BOUAZIZ (BOUAZIZ NOURDDINE)",
"author_email": "<nourddine.bouaziz.dz@gmail.com>",
"download_url": "",
"platform": null,
"description": "\r\n\r\n# Project nelogopy \r\n\r\nnelogopy : Usage netlogo by python\r\n\r\n\r\n## Developer by\r\n\r\n- BOUAZIZ Nourddine : [@Bouaziz19](https://github.com/Bouaziz19)\r\n\r\n\r\n## Installation\r\n\r\n\r\n\r\n1- install netlogo \ud83d\udd17\r\n \r\n[![Netlogo](https://ccl.northwestern.edu/netlogo/images/netlogo-title-wide-60.jpg)](https://ccl.northwestern.edu/netlogo/download.shtml)\r\n\r\n2-install nelogopy\r\n```bash\r\nconda install openjdk -y\r\npip install nelogopy\r\npip install nelogopy --upgrade\r\n```\r\n3- VS Code\r\n\r\nSet Default Terminal In VS Code :Command Line Interface (CLI)\r\n[\ud83d\udd17](https://www.w3schools.io/editor/vscode-change-default-terminal/)\r\n[\ud83d\udd17](https://stackoverflow.com/questions/44435697/change-the-default-terminal-in-visual-studio-code)\r\n\r\n## Example TEST\r\n\r\n \r\n```python\r\nimport time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n \r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n n.close_model()\r\n\r\n```\r\n## Colors\r\n\r\nColors \r\n\r\n![Colors](https://ccl.northwestern.edu/netlogo/docs/images/colors.jpg)\r\n\r\n\r\n## Usage/Examples\r\n \r\n1- pyturtle\r\n \r\n```python\r\nimport time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n \r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n n.close_model()\r\n\r\n```\r\n2-set_background\r\n ```python\r\nimport time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n path_image =\"path/to/image/nelogopy.png\"\r\n # path_image= \"C:/Nouveau dossier/nelogopy/Examples/nelogopy.png\"\r\n set_background(n,path_image)\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n \r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n n.close_model()\r\n```\r\n3-street\r\n ```python\r\nimport time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n n.close_model()\r\n```\r\n4-Fd\r\n ```python\r\n import time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n car01.fd(1)\r\n n.close_model()\r\n```\r\n5-netlogoshow\r\n ```python\r\nimport time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\")\r\n word=str(car01.id) +\" \" +str(i)\r\n netlogoshow(n,word) \r\n print(word)\r\n car01.fd(1)\r\n n.close_model()\r\n```\r\n6-distanceto\r\n ```python\r\n import time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n car01.fd(1)\r\n word=car01.distanceto(car02)\r\n print(word)\r\n netlogoshow(n,word)\r\n n.close_model()\r\n```\r\n7-face_to\r\n ```python\r\n import time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n car01.fd(1)\r\n if i==5:\r\n car01.face_to(car02)\r\n n.close_model()\r\n```\r\n8-move_to\r\n ```python\r\n import time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n car01.fd(1)\r\n if i==5:\r\n car01.move_to(car02)\r\n \r\n n.close_model()\r\n```\r\n9-hideturtle\r\n ```python\r\n import time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n car01.fd(1)\r\n if i==5:\r\n car01.hideturtle()\r\n \r\n n.close_model()\r\n```\r\n10-set_shape\r\n ```python\r\n import time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,100):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n car01.fd(1)\r\n if i==5:\r\n car01.set_shape('default')\r\n \r\n n.close_model()\r\n```\r\n\r\n11-getxyturtle\r\n ```python\r\nimport time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n car01.fd(1)\r\n xy=getxyturtle(n,car01)\r\n x=xy[0]\r\n y=xy[1]\r\n print(\"xy : \",xy)\r\n print(\"x : \",x)\r\n print(\"y : \",y)\r\n n.close_model()\r\n```\r\n12-setxy\r\n ```python\r\nimport time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,100):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n car01.fd(1)\r\n if i==5:\r\n car01.setxy(10,10)\r\n \r\n n.close_model()\r\n```\r\n13-distancebetween\r\n ```python\r\nimport time\r\nfrom nelogopy.nelogopy import *\r\n\r\nif __name__ == \"__main__\" :\r\n # Change netlogo_home\r\n netlogo_home=\"C:/Program Files/NetLogo 6.2.2\"\r\n n=run_netlogo(netlogo_home)\r\n # Resize world\r\n resize_world(n,0,60,0,60)\r\n # Change path fo image\r\n car01=pyturtle(n,x=20,y=20,shape=\"car\",size_shape=4,color=15,name=\"car01\",labelcolor=15)\r\n car02=pyturtle(n,x=5,y=5,shape=\"car\",size_shape=4,color=55,name=\"car02\",labelcolor=55)\r\n street( n,fromm=car01,too=car02,label=\"street\",labelcolor=35,color=35,shape=\"aa\",thickness=0.5)\r\n for i in range(0,10):\r\n time.sleep(1)\r\n print(\"*********** \",i,\" ********\") \r\n car01.fd(1)\r\n word=distancebetween(n,car01,car02)\r\n print(word)\r\n n.close_model()\r\n```\r\n",
"bugtrack_url": null,
"license": "",
"summary": "nelogopy : Usage netlogo by python",
"version": "0.0.14",
"project_urls": null,
"split_keywords": [
"python",
"netlogo",
"simulation",
"multi agent"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "59f74f3520ee7c092d60b212317c0cc324439030ff9ec8e54727600ea4f4a4f1",
"md5": "cdec6f62debe778c23fe0df3837d61db",
"sha256": "20208e4c13391eee86bce355f473f34c2c5b2aa2b34c2cbd59cbb1c822a3da14"
},
"downloads": -1,
"filename": "nelogopy-0.0.14-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cdec6f62debe778c23fe0df3837d61db",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 61284,
"upload_time": "2023-11-11T13:53:53",
"upload_time_iso_8601": "2023-11-11T13:53:53.754332Z",
"url": "https://files.pythonhosted.org/packages/59/f7/4f3520ee7c092d60b212317c0cc324439030ff9ec8e54727600ea4f4a4f1/nelogopy-0.0.14-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-11 13:53:53",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "nelogopy"
}